com.dxfeed.event.candle
Class CandleExchange

java.lang.Object
  extended by com.dxfeed.event.candle.CandleExchange
All Implemented Interfaces:
CandleSymbolAttribute<CandleExchange>

public class CandleExchange
extends Object
implements CandleSymbolAttribute<CandleExchange>

Exchange attribute of CandleSymbol defines exchange identifier where data is taken from to build the candles.

Implementation details

This attribute is encoded in a symbol string with MarketEventSymbols.getExchangeCode and changeExchangeCode methods.


Field Summary
static CandleExchange COMPOSITE
          Composite exchange where data is taken from all exchanges.
static CandleExchange DEFAULT
          Default exchange is COMPOSITE.
 
Method Summary
 String changeAttributeForSymbol(String symbol)
          Returns candle event symbol string with this exchange set.
 void checkInAttributeImpl(CandleSymbol candleSymbol)
          Internal method that initializes attribute in the candle symbol.
 boolean equals(Object o)
          Indicates whether this exchange attribute is the same as another one.
static CandleExchange getAttributeForSymbol(String symbol)
          Returns exchange attribute object of the given candle symbol string.
 char getExchangeCode()
          Returns exchange code.
 int hashCode()
          Returns hash code of this exchange attribute.
 String toString()
          Returns string representation of this exchange.
static CandleExchange valueOf(char exchangeCode)
          Returns exchange attribute object that corresponds to the specified exchange code character.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPOSITE

public static final CandleExchange COMPOSITE
Composite exchange where data is taken from all exchanges.


DEFAULT

public static final CandleExchange DEFAULT
Default exchange is COMPOSITE.

Method Detail

getExchangeCode

public char getExchangeCode()
Returns exchange code. It is '\0' for COMPOSITE exchange.

Returns:
exchange code.

toString

public String toString()
Returns string representation of this exchange. It is the string "COMPOSITE" for COMPOSITE exchange or exchange character otherwise.

Overrides:
toString in class Object
Returns:
string representation of this exchange.

equals

public boolean equals(Object o)
Indicates whether this exchange attribute is the same as another one.

Overrides:
equals in class Object
Returns:
true if this exchange attribute is the same as another one.

hashCode

public int hashCode()
Returns hash code of this exchange attribute.

Overrides:
hashCode in class Object
Returns:
hash code of this exchange attribute.

changeAttributeForSymbol

public String changeAttributeForSymbol(String symbol)
Returns candle event symbol string with this exchange set.

Specified by:
changeAttributeForSymbol in interface CandleSymbolAttribute<CandleExchange>
Parameters:
symbol - original candle event symbol.
Returns:
candle event symbol string with this exchange set.

checkInAttributeImpl

public void checkInAttributeImpl(CandleSymbol candleSymbol)
Internal method that initializes attribute in the candle symbol.

Specified by:
checkInAttributeImpl in interface CandleSymbolAttribute<CandleExchange>
Parameters:
candleSymbol - candle symbol.
Throws:
IllegalStateException - if used outside of internal initialization logic.

valueOf

public static CandleExchange valueOf(char exchangeCode)
Returns exchange attribute object that corresponds to the specified exchange code character.

Parameters:
exchangeCode - exchange code character.
Returns:
exchange attribute object.

getAttributeForSymbol

public static CandleExchange getAttributeForSymbol(String symbol)
Returns exchange attribute object of the given candle symbol string. The result is DEFAULT if the symbol does not have exchange attribute.

Parameters:
symbol - candle symbol string.
Returns:
exchange attribute object of the given candle symbol string.


Copyright © 2013 Devexperts. All Rights Reserved.