StocksMonitor 1.5.0

hirondelle.stocks.quotes
Class Exchange

Object
  extended by Exchange
All Implemented Interfaces:
Comparable<Exchange>

public final class Exchange
extends Object
implements Comparable<Exchange>

Enumeration for all exchanges used by the Yahoo quote system.

The full name of the Exchange is used as an identifier. All other items are attached to the full name.

This type-safe enumeration is unusual in that each element is not declared or exported individually; rather, the VALUES field includes all elements in one Collection. Thus, the caller cannot refer to specific Exchange objects.


Field Summary
static List<Exchange> VALUES
          Allows caller to iterate over all elements of the enumeration.
 
Method Summary
 int compareTo(Exchange that)
           
 String getTickerSuffix()
          Return the suffix representing the Exchange (excluding dot).
 String toString()
          Return the full name of this Exchange, suitable for presentation to the end user.
static Exchange valueFrom(String aText)
          Convert aText into its corresponding Exchange object, if possible.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VALUES

public static final List<Exchange> VALUES
Allows caller to iterate over all elements of the enumeration.

Method Detail

getTickerSuffix

public String getTickerSuffix()
Return the suffix representing the Exchange (excluding dot).

These suffixes are defined by Yahoo, and are appended to tickers in order to provide an exact identification of a traded entity. For example, the Toronto Stock Exchange is assigned the TO suffix. Yahoo will append .TO to all tickers defined by the Toronto Stock Exchange.

In this system, some exchanges (for example, the NYSE) do not have a suffix. In this case, an empty String is returned.

The suffix is not intended for display to the end user; rather, these suffixes should be an internal detail hidden from them.


toString

public String toString()
Return the full name of this Exchange, suitable for presentation to the end user.

The suffix is not included in the return value.

Overrides:
toString in class Object

valueFrom

public static Exchange valueFrom(String aText)
Convert aText into its corresponding Exchange object, if possible.

Parameters:
aText - possibly-null text which may map to an Exchange.
Returns:
null if aText is null, else try to match to the Exchange whose toString() equals aText.
Throws:
IllegalArgumentException - if a non-null aText cannot be matched to a known enumeration element.

compareTo

public int compareTo(Exchange that)
Specified by:
compareTo in interface Comparable<Exchange>

StocksMonitor 1.5.0

Copyright Hirondelle Systems - License - Generated 2008Jul12.10.53