com.dxfeed.glossary
Class CFI

java.lang.Object
  extended by com.dxfeed.glossary.CFI
All Implemented Interfaces:
java.io.Serializable

public class CFI
extends java.lang.Object
implements java.io.Serializable

A wrapper class for Classification of Financial Instruments code as defined in ISO 10962 standard. Main purpose is to provide code validity checks and to construct textual explanation of CFI code as defined in the standard via Java API. This class does not provide API-accessible constants for specific instrument attributes and values.

See Also:
Serialized Form

Nested Class Summary
static class CFI.Attribute
          Describes single attribute with all values as defined in the ISO 10962 standard.
static class CFI.Value
          Describes single value of single character of CFI code as defined in the ISO 10962 standard.
 
Field Summary
static CFI EMPTY
          Empty CFI - it has code "XXXXXX".
 
Method Summary
 CFI.Value[] decipher()
          Returns array of values that explain meaning of each character in the CFI code.
 java.lang.String describe()
          Returns short textual description of this CFI code by listing names of all values for the characters in this CFI code.
 boolean equals(java.lang.Object obj)
           
 char getCategory()
          Returns single character for instrument category - the first character of the CFI code.
 java.lang.String getCode()
          Returns CFI code.
 char getGroup()
          Returns single character for instrument group - the second character of the CFI code.
 int getIntCode()
          Returns integer representation of CFI code.
 int hashCode()
           
 boolean isDebtInstrument()
          Returns true if corresponding instrument is a debt instrument.
 boolean isEntitlement()
          Returns true if corresponding instrument is an entitlement (right).
 boolean isEquity()
          Returns true if corresponding instrument is an equity.
 boolean isFuture()
          Returns true if corresponding instrument is a future.
 boolean isOption()
          Returns true if corresponding instrument is an option.
 boolean isOther()
          Returns true if corresponding instrument is an other (miscellaneous) instrument.
 java.lang.String toString()
           
static CFI valueOf(int intCode)
          Returns an instance of CFI for specified integer representation of CFI code.
static CFI valueOf(java.lang.String code)
          Returns an instance of CFI for specified CFI code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final CFI EMPTY
Empty CFI - it has code "XXXXXX".

Method Detail

valueOf

public static CFI valueOf(java.lang.String code)
Returns an instance of CFI for specified CFI code. Accepts short code and expands it to 6 letters by appending "X" at the end.

Throws:
java.lang.IllegalArgumentException - if code is invalid

valueOf

public static CFI valueOf(int intCode)
Returns an instance of CFI for specified integer representation of CFI code.

Throws:
java.lang.IllegalArgumentException - if code is invalid

getCode

public java.lang.String getCode()
Returns CFI code. The code always has length of 6 characters.


getIntCode

public int getIntCode()
Returns integer representation of CFI code.


getCategory

public char getCategory()
Returns single character for instrument category - the first character of the CFI code.


getGroup

public char getGroup()
Returns single character for instrument group - the second character of the CFI code.


isEquity

public boolean isEquity()
Returns true if corresponding instrument is an equity.


isDebtInstrument

public boolean isDebtInstrument()
Returns true if corresponding instrument is a debt instrument.


isEntitlement

public boolean isEntitlement()
Returns true if corresponding instrument is an entitlement (right).


isOption

public boolean isOption()
Returns true if corresponding instrument is an option.


isFuture

public boolean isFuture()
Returns true if corresponding instrument is a future.


isOther

public boolean isOther()
Returns true if corresponding instrument is an other (miscellaneous) instrument.


decipher

public CFI.Value[] decipher()
Returns array of values that explain meaning of each character in the CFI code. Array always has length of 6 and each value explains corresponding character. If certain character is unapplicable, unknown or unrecognized - corresponding value will contain reference to this fact.


describe

public java.lang.String describe()
Returns short textual description of this CFI code by listing names of all values for the characters in this CFI code. See also decipher() method.


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object