public class Quote extends MarketEvent implements LastingEvent<String>
Quote
event has the following properties:
eventSymbol
- symbol of this event;
timeNanoPart
- microseconds and nanoseconds part of time of the last bid or ask change;
sequence
- sequence of this quote;
bidTime
- time of the last bid change;
bidExchangeCode
- bid exchange code;
bidPrice
- bid price;
bidSize
- bid size as integer number (rounded toward zero);
bidSizeAsDouble
- bid size as floating number with fractions;
askTime
- time of the last ask change;
askExchangeCode
- ask exchange code;
askPrice
- ask price;
askSize
- ask size as integer number (rounded toward zero);
askSizeAsDouble
- ask size as floating number with fractions.
Quote
and Quote&X
for regional exchange best quotes.Modifier and Type | Field and Description |
---|---|
static int |
MAX_SEQUENCE
Maximum allowed sequence value.
|
Constructor and Description |
---|
Quote()
Creates new quote with default values.
|
Quote(String eventSymbol)
Creates new quote with the specified event symbol.
|
Modifier and Type | Method and Description |
---|---|
char |
getAskExchangeCode()
Returns ask exchange code.
|
double |
getAskPrice()
Returns ask price.
|
long |
getAskSize()
Returns ask size as integer number (rounded toward zero).
|
double |
getAskSizeAsDouble()
Returns ask size as floating number with fractions.
|
long |
getAskTime()
Returns time of the last ask change.
|
char |
getBidExchangeCode()
Returns bid exchange code.
|
double |
getBidPrice()
Returns bid price.
|
long |
getBidSize()
Returns bid size as integer number (rounded toward zero).
|
double |
getBidSizeAsDouble()
Returns bid size as floating number with fractions.
|
long |
getBidTime()
Returns time of the last bid change.
|
int |
getSequence()
Returns sequence number of this quote to distinguish quotes that have the same
time . |
long |
getTime()
Returns time of the last bid or ask change.
|
int |
getTimeNanoPart()
Returns microseconds and nanoseconds part of time of the last bid or ask change.
|
long |
getTimeNanos()
Returns time of the last bid or ask change in nanoseconds.
|
void |
setAskExchangeCode(char askExchangeCode)
Changes ask exchange code.
|
void |
setAskPrice(double askPrice)
Changes ask price.
|
void |
setAskSize(long askSize)
Changes ask size as integer number (rounded toward zero).
|
void |
setAskSizeAsDouble(double askSize)
Changes ask size as floating number with fractions.
|
void |
setAskTime(long askTime)
Changes time of the last ask change.
|
void |
setBidExchangeCode(char bidExchangeCode)
Changes bid exchange code.
|
void |
setBidPrice(double bidPrice)
Changes bid price.
|
void |
setBidSize(long bidSize)
Changes bid size as integer number (rounded toward zero).
|
void |
setBidSizeAsDouble(double bidSize)
Changes bid size as floating number with fractions.
|
void |
setBidTime(long bidTime)
Changes time of the last bid change.
|
void |
setSequence(int sequence)
Changes
getSequence() sequence number} of this quote. |
void |
setTimeNanoPart(int timeNanoPart)
Changes microseconds and nanoseconds part of time of the last bid or ask change.
|
String |
toString()
Returns string representation of this quote event.
|
getEventSymbol, getEventTime, setEventSymbol, setEventTime
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEventSymbol, getEventTime, setEventSymbol, setEventTime
public static final int MAX_SEQUENCE
setSequence(int)
,
Constant Field Valuespublic Quote()
public Quote(String eventSymbol)
eventSymbol
- event symbol.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 quote.sequence
- the sequence.IllegalArgumentException
- if sequence is below zero or above MAX_SEQUENCE
.getSequence()
public long getTime()
This method is the same as
Math.max(
.
Use getBidTime
(), getAskTime
()}setBidTime(long)
and setAskTime(long)
in order to change this time.
Note, that unlike bid/ask times, that are transmitted over network in a second-precision, this
time is transmitted up to a millisecond and even nano-second precision (see getTimeNanoPart()
)
if DXEndpoint.DXSCHEME_NANO_TIME_PROPERTY
is set to true
.
public long getTimeNanos()
public void setTimeNanoPart(int timeNanoPart)
This method changes getTimeNanos()
result.
timeNanoPart
- microseconds and nanoseconds part of time of the last bid or ask change.public int getTimeNanoPart()
public long getBidTime()
This time is always transmitted with seconds precision, so the result of this method is usually a multiple of 1000.
public void setBidTime(long bidTime)
You can set the actual millisecond-precision time here to publish event and the millisecond part
will make the time
of this quote even precise up to a millisecond.
bidTime
- time of the last bid change.public char getBidExchangeCode()
public void setBidExchangeCode(char bidExchangeCode)
bidExchangeCode
- bid exchange code.public double getBidPrice()
public void setBidPrice(double bidPrice)
bidPrice
- bid price.public long getBidSize()
public void setBidSize(long bidSize)
bidSize
- bid size as integer number (rounded toward zero).public double getBidSizeAsDouble()
public void setBidSizeAsDouble(double bidSize)
bidSize
- bid size as floating number with fractions.public long getAskTime()
This time is always transmitted with seconds precision, so the result of this method is usually a multiple of 1000.
public void setAskTime(long askTime)
You can set the actual millisecond-precision time here to publish event and the millisecond part
will make the time
of this quote even precise up to a millisecond.
askTime
- time of the last ask change.public char getAskExchangeCode()
public void setAskExchangeCode(char askExchangeCode)
askExchangeCode
- ask exchange code.public double getAskPrice()
public void setAskPrice(double askPrice)
askPrice
- ask price.public long getAskSize()
public void setAskSize(long askSize)
askSize
- ask size as integer number (rounded toward zero).public double getAskSizeAsDouble()
public void setAskSizeAsDouble(double askSize)
askSize
- ask size as floating number with fractions.Copyright © 2002–2023 Devexperts LLC. All rights reserved.