com.dxfeed.event.market
Class Trade

java.lang.Object
  extended by com.dxfeed.event.market.MarketEvent
      extended by com.dxfeed.event.market.Trade
All Implemented Interfaces:
LastingEvent, Serializable

public final class Trade
extends MarketEvent
implements LastingEvent

Trade event is a snapshot of the price and size of the last trade and other fields that change with each trade. It represents the most recent information that is available about the last trade on the market at any given moment of time.

Implementation details

This event is implemented on top of QDS records Trade and Trade&X for regional exchange trades.

See Also:
Serialized Form

Constructor Summary
Trade()
          Creates new trade with default values.
Trade(String eventSymbol)
          Creates new trade with the specified event symbol.
 
Method Summary
 long getDayVolume()
          Returns total volume traded for a day.
 char getExchangeCode()
          Returns exchange code of the last trade.
 double getPrice()
          Returns price of the last trade.
 long getSize()
          Returns size of the last trade.
 long getTime()
          Returns time of the last trade.
 void setDayVolume(long dayVolume)
          Changes total volume traded for a day.
 void setExchangeCode(char exchangeCode)
          Changes exchange code of the last trade.
 void setPrice(double price)
          Changes price of the last trade.
 void setSize(long size)
          Changes size of the last trade.
 void setTime(long time)
          Changes time of the last trade.
 String toString()
          Returns string representation of this trade event.
 
Methods inherited from class com.dxfeed.event.market.MarketEvent
getEventSymbol, setEventSymbol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trade

public Trade()
Creates new trade with default values.


Trade

public Trade(String eventSymbol)
Creates new trade with the specified event symbol.

Parameters:
eventSymbol - event symbol.
Method Detail

getTime

public long getTime()
Returns time of the last trade. Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Returns:
time of the last trade.

setTime

public void setTime(long time)
Changes time of the last trade. Time is measured in milliseconds between the current time and midnight, January 1, 1970 UTC.

Parameters:
time - time of the last trade.

getExchangeCode

public char getExchangeCode()
Returns exchange code of the last trade.

Returns:
exchange code of the last trade.

setExchangeCode

public void setExchangeCode(char exchangeCode)
Changes exchange code of the last trade.

Parameters:
exchangeCode - exchange code of the last trade.

getPrice

public double getPrice()
Returns price of the last trade.

Returns:
price of the last trade.

setPrice

public void setPrice(double price)
Changes price of the last trade.

Parameters:
price - price of the last trade.

getSize

public long getSize()
Returns size of the last trade.

Returns:
size of the last trade.

setSize

public void setSize(long size)
Changes size of the last trade.

Parameters:
size - size of the last trade.

getDayVolume

public long getDayVolume()
Returns total volume traded for a day.

Returns:
total volume traded for a day.

setDayVolume

public void setDayVolume(long dayVolume)
Changes total volume traded for a day.

Parameters:
dayVolume - total volume traded for a day.

toString

public String toString()
Returns string representation of this trade event.

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


Copyright © 2013 Devexperts. All Rights Reserved.