com.oanda.fxtrade.api
Interface FXTick

All Superinterfaces:
java.lang.Cloneable

public interface FXTick
extends java.lang.Cloneable

An FXTick object represents a single forex spot price.


Method Summary
 java.lang.Object clone()
          Returns a exact copy of this FXTick.
 boolean equals(java.lang.Object o)
          Compares two FXTick objects.
 double getAsk()
          Returns the ask price.
 double getBid()
          Returns the bid price.
 FXTick getInverse()
          Return a new FXTick which is the inverse of this FXTick.
 long getMaxUnits()
          Returns the maximum amount of units this tick applies for.
 double getMean()
           
 FXPair getPair()
           
 long getTimestamp()
          Returns the unix timestamp for this FXTick.
 int hashCode()
          Return the hashcode of this pair
 void setAsk(double ask)
          Sets the ask price.
 void setBid(double bid)
          Sets the bid price.
 void setMaxUnits(long maxUnits)
          Sets the max units this tick is valid for.
 void setTimestamp(long timestamp)
          Sets the timestamp.
 java.lang.String toString()
           
 

Method Detail

clone

java.lang.Object clone()
Returns a exact copy of this FXTick.


equals

boolean equals(java.lang.Object o)
Compares two FXTick objects.

Overrides:
equals in class java.lang.Object
Parameters:
o - the FXTick to be compared
Returns:
true if the timestamp, bid and ask are exactly equal, false otherwise

getPair

FXPair getPair()

getAsk

double getAsk()
Returns the ask price.

Returns:
the ask price

getBid

double getBid()
Returns the bid price.

Returns:
the bid price

getInverse

FXTick getInverse()
Return a new FXTick which is the inverse of this FXTick.

Note: bid = 1 / ask ; ask = 1 / bid

Returns:
a new FXTick which is the inverse of this FXTick.

getMean

double getMean()

getTimestamp

long getTimestamp()
Returns the unix timestamp for this FXTick.

Returns:
the unix timestamp for this FXTick.

hashCode

int hashCode()
Return the hashcode of this pair

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode of this pair

setAsk

void setAsk(double ask)
Sets the ask price. TODO remove this method when implementation staged

Parameters:
ask - the ask price

setBid

void setBid(double bid)
Sets the bid price. TODO remove this method when implementation staged

Parameters:
bid - the bid price

setTimestamp

void setTimestamp(long timestamp)
Sets the timestamp. TODO remove this method when implementation staged

Parameters:
timestamp - the timestamp

getMaxUnits

long getMaxUnits()
Returns the maximum amount of units this tick applies for.

Returns:
the maximum amount of units this tick applies for

setMaxUnits

void setMaxUnits(long maxUnits)
Sets the max units this tick is valid for.

Parameters:
maxUnits - max units this tick is valid for

toString

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


Copyright © 2005 OANDA Corporation. All Rights Reserved.