public final class Exchange extends Object implements Comparable<Exchange>
Warning: this is an example of an older-style enumeration. A more modern style would use an 'enum', instead of a class.
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.
Modifier and Type | Field and Description |
---|---|
static List<Exchange> |
VALUES
Allows caller to iterate over all elements of the enumeration.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public String getTickerSuffix()
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.
public String toString()
The suffix is not included in the return value.
public static Exchange valueFrom(String aText)
aText
- possibly-null text which may map to an Exchange.toString()
equals aText.IllegalArgumentException
- if a non-null aText
cannot be matched to a known enumeration element.public int compareTo(Exchange that)
compareTo
in interface Comparable<Exchange>
Copyright Hirondelle Systems - License - Generated 2013Sep20.10.58