com.shimari.fxtp
Class FXTP_Order

java.lang.Object
  extended bycom.shimari.fxtp.FXTP_Order
All Implemented Interfaces:
java.lang.Comparable

public class FXTP_Order
extends java.lang.Object
implements java.lang.Comparable

A Bean representing an Order on FXTP--something that would reside in a book, and we typically call a set of orders a Book.


Constructor Summary
FXTP_Order(java.lang.Integer userId, java.lang.String symbol, int quantity, int price, boolean isABid)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Sort by symbol, bid/ask, price, quantity, and user id.
 boolean equals(java.lang.Object o)
           
 int getContractPrice()
          This is the actual price for the underlying contracts.
 double getCost()
           
 java.lang.Integer getId()
          The id of the user who submitted the order.
 int getPrice()
          This price is the "positive" price used in quoting bid/ask ranges for yes contracts.
 int getQuantity()
          This value is always positive, and represents the number of contracts ordered.
 int getSignedQuantity()
          Return the quantity as a positive number for bids, and negative number for asks.
 java.lang.String getSymbol()
           
 int hashCode()
           
 boolean isBid()
          True if this is an order to purchase yes contracts; false if it is an order to purchase no contracts.
 java.lang.String toShortString()
          Return a string representing the order omitting the user and the symbol.
 java.lang.String toString()
          Returns a string representing the order, including the symbol.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FXTP_Order

public FXTP_Order(java.lang.Integer userId,
                  java.lang.String symbol,
                  int quantity,
                  int price,
                  boolean isABid)
Method Detail

toString

public java.lang.String toString()
Returns a string representing the order, including the symbol.


equals

public boolean equals(java.lang.Object o)

hashCode

public int hashCode()

compareTo

public int compareTo(java.lang.Object o)
Sort by symbol, bid/ask, price, quantity, and user id.

Specified by:
compareTo in interface java.lang.Comparable

toShortString

public java.lang.String toShortString()
Return a string representing the order omitting the user and the symbol.


isBid

public boolean isBid()
True if this is an order to purchase yes contracts; false if it is an order to purchase no contracts.


getSymbol

public java.lang.String getSymbol()

getId

public java.lang.Integer getId()
The id of the user who submitted the order.


getPrice

public int getPrice()
This price is the "positive" price used in quoting bid/ask ranges for yes contracts.

Returns:

getContractPrice

public int getContractPrice()
This is the actual price for the underlying contracts. For bids it is the same as getPrice(), for asks it is (100 - getPrice()), which is the price of the no contract.

Returns:

getQuantity

public int getQuantity()
This value is always positive, and represents the number of contracts ordered.


getSignedQuantity

public int getSignedQuantity()
Return the quantity as a positive number for bids, and negative number for asks.


getCost

public double getCost()