com.dxfeed.event.candle
Class Candle

java.lang.Object
  extended by com.dxfeed.event.candle.Candle
All Implemented Interfaces:
LastingEvent, TimeSeriesEvent, java.io.Serializable

@EventType
public class Candle
extends java.lang.Object
implements TimeSeriesEvent, LastingEvent, java.io.Serializable

See Also:
Serialized Form

Field Summary
static int MAX_SEQUENCE
           
 
Constructor Summary
Candle()
           
Candle(CandleSymbol eventSymbol)
           
 
Method Summary
 double getClose()
           
 long getCount()
           
 long getEventId()
          Returns identifier of this event.
 CandleSymbol getEventSymbol()
           
 double getHigh()
           
 double getLow()
           
 double getOpen()
           
 int getSequence()
          Returns sequence number of this event to distinguish events that has the same time.
 long getTime()
          Returns timestamp of original event in milliseconds.
 long getVolume()
           
 double getVWAP()
           
 void setClose(double close)
           
 void setCount(long count)
           
 void setEventId(long eventId)
          Changes identifier for this event.
 void setEventSymbol(CandleSymbol eventSymbol)
           
 void setHigh(double high)
           
 void setLow(double low)
           
 void setOpen(double open)
           
 void setSequence(int sequence)
          Changes getSequence() sequence number} of this event.
 void setTime(long time)
          Changes time spate of event in milliseconds.
 void setVolume(long volume)
           
 void setVWAP(double vwap)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_SEQUENCE

public static final int MAX_SEQUENCE
See Also:
Constant Field Values
Constructor Detail

Candle

public Candle()

Candle

public Candle(CandleSymbol eventSymbol)
Method Detail

getEventSymbol

public CandleSymbol getEventSymbol()

setEventSymbol

public void setEventSymbol(CandleSymbol eventSymbol)

getEventId

public long getEventId()
Returns identifier of this event. Event identifiers are unique within event symbol. Event identifier is composed of time and sequence. Changing either time or sequence changes event identifier.

Specified by:
getEventId in interface TimeSeriesEvent
Returns:
unique event identifier.

setEventId

public void setEventId(long eventId)
Changes identifier for this event. Because, event identifier is composed of time and sequence, invocation of this method changes time and sequence.

Parameters:
eventId - the event identifier.
See Also:
getEventId()

getTime

public long getTime()
Returns timestamp of original event in milliseconds.

Specified by:
getTime in interface TimeSeriesEvent
Returns:
timestamp of original event in milliseconds

setTime

public void setTime(long time)
Changes time spate of event in milliseconds.

Parameters:
time - timestamp in milliseconds.
See Also:
getTime()

getSequence

public int getSequence()
Returns sequence number of this event to distinguish events that has the same time. This sequence number does not have to be unique and does not need to be sequential. Sequence can range from 0 to MAX_SEQUENCE.


setSequence

public void setSequence(int sequence)
Changes getSequence() sequence number} of this event.

Parameters:
sequence - the sequence.
Throws:
java.lang.IllegalArgumentException - if sequence is below zero or above MAX_SEQUENCE.
See Also:
getSequence()

getCount

public long getCount()

setCount

public void setCount(long count)

getOpen

public double getOpen()

setOpen

public void setOpen(double open)

getHigh

public double getHigh()

setHigh

public void setHigh(double high)

getLow

public double getLow()

setLow

public void setLow(double low)

getClose

public double getClose()

setClose

public void setClose(double close)

getVolume

public long getVolume()

setVolume

public void setVolume(long volume)

getVWAP

public double getVWAP()

setVWAP

public void setVWAP(double vwap)

toString

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