package sesim; public abstract class Order implements Comparable { /** * When the order was created */ public long timestamp = 0; /** * Number of shares */ public long volume; /** * Limit price */ public double limit; /** * Order ID */ public long id = 0; /** * Type of order */ public OrderType type; public Account account = null; protected int compareLimit(Order o){ int r=0; if (o.limit < limit) { r=-1; } if (o.limit > limit) { r=1; } if (type==OrderType.ask) return -r; return r; }; @Override public int compareTo(Order o) { if (o.type!=type){ System.out.print("OrderType Missmatch\n"); return -1; } int r = compareLimit(o); if (r!=0) return r; /* if (o.timestamp> timestamp) return -1; if (o.timestampid) return -1; if (o.id