|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dxfeed.event.market.MarketEvent
com.dxfeed.event.market.TimeAndSale
public final class TimeAndSale
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.
Field Summary | |
---|---|
static int |
MAX_SEQUENCE
|
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()
|
int |
getSequence()
Returns sequence number of this event to distinguish events that has the same time . |
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()
Deprecated. use isValidTick() instead. |
boolean |
isValidTick()
Returns whether this event represents a valid intraday tick. |
void |
setAskPrice(double askPrice)
|
void |
setBidPrice(double bidPrice)
|
void |
setCancel()
|
void |
setCorrection()
|
void |
setEventId(long eventId)
Changes identifier for this event. |
void |
setExchangeCode(char exchangeCode)
|
void |
setExchangeSaleConditions(java.lang.String exchangeSaleConditions)
|
void |
setNew()
|
void |
setPrice(double price)
|
void |
setSequence(int sequence)
Changes getSequence() sequence number} of this event. |
void |
setSize(long size)
|
void |
setTime(long time)
Changes time spate of event in milliseconds. |
void |
setTrade(boolean isValidTick)
Deprecated. use setValidTick(boolean) instead. |
void |
setValidTick(boolean isValidTick)
|
java.lang.String |
toString()
|
Methods inherited from class com.dxfeed.event.market.MarketEvent |
---|
getEventSymbol, setEventSymbol |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_SEQUENCE
Constructor Detail |
---|
public TimeAndSale()
public TimeAndSale(java.lang.String eventSymbol)
Method Detail |
---|
public long getEventId()
time
and sequence
.
Changing either time or sequence changes event identifier.
getEventId
in interface TimeSeriesEvent
public void setEventId(long eventId)
time
and sequence
,
invocation of this method changes time and sequence.
eventId
- the event identifier.getEventId()
public long getTime()
getTime
in interface TimeSeriesEvent
public void setTime(long time)
time
- timestamp in milliseconds.getTime()
public int getSequence()
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
.
public void setSequence(int sequence)
getSequence()
sequence number} of this event.
sequence
- the sequence.
java.lang.IllegalArgumentException
- if sequence is below zero or above MAX_SEQUENCE
.getSequence()
public char getExchangeCode()
public void setExchangeCode(char exchangeCode)
public double getPrice()
public void setPrice(double price)
public long getSize()
public void setSize(long size)
public double getBidPrice()
public void setBidPrice(double bidPrice)
public double getAskPrice()
public void setAskPrice(double askPrice)
public java.lang.String getExchangeSaleConditions()
public void setExchangeSaleConditions(java.lang.String exchangeSaleConditions)
@Deprecated public boolean isTrade()
isValidTick()
instead.
true
if this event represents a valid intraday tick.@Deprecated public void setTrade(boolean isValidTick)
setValidTick(boolean)
instead.
isValidTick
- whether this event is a valid tickpublic boolean isValidTick()
true
if this event represents a valid intraday tick.public void setValidTick(boolean isValidTick)
public boolean isNew()
public void setNew()
public boolean isCorrection()
public void setCorrection()
public boolean isCancel()
public void setCancel()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |