com.dxfeed.api.event
Class TimeAndSale

java.lang.Object
  extended by com.dxfeed.api.event.Event
      extended by com.dxfeed.api.event.TimeAndSale

public final class TimeAndSale
extends Event

Time and Sale represents a trade (or other market event with price, e.g. market open/close price, etc.). Time and Sales are intended to provide information about trades in a continuous time slice (unlike Trade events which are supposed to provide information about the current last trade). Time and Sale events have unique event IDs which can be used for later correction/cancellation processing.


Constructor Summary
TimeAndSale()
           
TimeAndSale(java.lang.String eventSymbol)
           
 
Method Summary
 double getAskPrice()
           
 double getBidPrice()
           
 long getEventId()
          Returns identifier of this event.
 char getExchangeCode()
           
 java.lang.String getExchangeSaleConditions()
          Returns sale conditions provided for this event by data feed.
 double getPrice()
           
 long getSize()
           
 long getTime()
          Returns timestamp of original event in milliseconds.
 boolean isCancel()
          Returns whether this is a cancellation of a previous event.
 boolean isCorrection()
          Returns whether this is a correction of a previous event.
 boolean isNew()
          Returns whether this is a new event (not cancellation or correction).
 boolean isTrade()
          Returns true if this event represents a trade.
 void setAskPrice(double askPrice)
           
 void setBidPrice(double bidPrice)
           
 void setCancel()
           
 void setCorrection()
           
 void setEventId(long eventId)
           
 void setExchangeCode(char exchangeCode)
           
 void setExchangeSaleConditions(java.lang.String exchangeSaleConditions)
           
 void setNew()
           
 void setPrice(double price)
           
 void setSize(long size)
           
 void setTime(long time)
           
 void setTrade(boolean trade)
           
 java.lang.String toString()
           
 
Methods inherited from class com.dxfeed.api.event.Event
getEventSymbol, setEventSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimeAndSale

public TimeAndSale()

TimeAndSale

public TimeAndSale(java.lang.String eventSymbol)
Method Detail

getEventId

public long getEventId()
Returns identifier of this event. Event identifiers are unique within event symbol. If this event is correction or cancel, then its identifier repeats original event identifier.

Returns:
unique event identifier

setEventId

public void setEventId(long eventId)

getTime

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

Returns:
timestamp of original event in milliseconds

setTime

public void setTime(long time)

getExchangeCode

public char getExchangeCode()

setExchangeCode

public void setExchangeCode(char exchangeCode)

getPrice

public double getPrice()

setPrice

public void setPrice(double price)

getSize

public long getSize()

setSize

public void setSize(long size)

getBidPrice

public double getBidPrice()

setBidPrice

public void setBidPrice(double bidPrice)

getAskPrice

public double getAskPrice()

setAskPrice

public void setAskPrice(double askPrice)

getExchangeSaleConditions

public java.lang.String getExchangeSaleConditions()
Returns sale conditions provided for this event by data feed. This field format is sepecifc for every particular data feed.

Returns:
sale conditions

setExchangeSaleConditions

public void setExchangeSaleConditions(java.lang.String exchangeSaleConditions)

isTrade

public boolean isTrade()
Returns true if this event represents a trade. Note, that correction for a previously distributed trade represents a new trade, but trade cancellation does not.

Returns:
true if this event is a trade

setTrade

public void setTrade(boolean trade)

isNew

public boolean isNew()
Returns whether this is a new event (not cancellation or correction).

Returns:
whether this is a new event (not cancellation or correction)

setNew

public void setNew()

isCorrection

public boolean isCorrection()
Returns whether this is a correction of a previous event.

Returns:
whether this is a correction of a previous event

setCorrection

public void setCorrection()

isCancel

public boolean isCancel()
Returns whether this is a cancellation of a previous event.

Returns:
whether this is a cancellation of a previous event

setCancel

public void setCancel()

toString

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