net.commerce.zocalo.orders
Class SortedOrders

java.lang.Object
  extended by net.commerce.zocalo.orders.SortedOrders

public class SortedOrders
extends java.lang.Object

A collection of Orders on a single asset. Used by a Book to manage the orders and to find the best order when there is an offer.


Constructor Summary
SortedOrders(Position position, Price price)
           
 
Method Summary
 void add(Order o)
           
 Price bestPrice()
           
 Order getBest()
           
 Quantity getQuantityAtPrice(Price price)
           
 Price getSamplePrice()
          Deprecated.  
 boolean hasOrders()
           
 java.util.Iterator iterator()
           
 void printPrices(java.lang.StringBuffer buf)
           
 boolean remove(Order o)
           
 void setSamplePrice(Price samplePrice)
          Deprecated.  
 java.lang.String toString()
           
 Order[] usersOwnOrders(User user, boolean increasingOrder)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortedOrders

public SortedOrders(Position position,
                    Price price)
Method Detail

iterator

public java.util.Iterator iterator()

getBest

public Order getBest()

bestPrice

public Price bestPrice()

hasOrders

public boolean hasOrders()

add

public void add(Order o)
         throws DuplicateOrderException
Throws:
DuplicateOrderException

remove

public boolean remove(Order o)

getQuantityAtPrice

public Quantity getQuantityAtPrice(Price price)

usersOwnOrders

public Order[] usersOwnOrders(User user,
                              boolean increasingOrder)

printPrices

public void printPrices(java.lang.StringBuffer buf)

toString

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

getSamplePrice

public Price getSamplePrice()
Deprecated. 


setSamplePrice

public void setSamplePrice(Price samplePrice)
Deprecated.