support.Ticker
Class TickerEvent
java.lang.Object
|
+--support.Ticker.TickerEvent
- Direct Known Subclasses:
- BoughtEvent, BuyEvent, CancelEvent, SellEvent, SoldEvent, SpreadEvent
- public abstract class TickerEvent
- extends java.lang.Object
|
Constructor Summary |
protected |
TickerEvent(int id,
int nshares,
int price)
|
|
Method Summary |
(package private) void |
draw()
|
int |
id()
|
protected abstract java.lang.String |
name()
|
int |
price()
|
static java.lang.String |
printInt(int toprint,
int width,
char fill)
hacks around the lack of printf; stolen from StandardOps.java
in Flight. |
static java.lang.String |
printString(java.lang.String toprint,
int width,
char fill)
also hacks printf: this does the equivalent of %14s |
static java.lang.String |
printStringRight(java.lang.String toprint,
int width,
char fill)
also hacks printf: this does the equivalent of %-14s |
void |
setID(int id)
|
void |
setPrice(int price)
|
void |
setSize(int size)
|
int |
size()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
id_
private int id_
nshares_
private int nshares_
price_
private int price_
TickerEvent
protected TickerEvent(int id,
int nshares,
int price)
id
public int id()
- Returns:
- The event identification number
size
public int size()
- Returns:
- The number of shares involved
price
public int price()
- Returns:
- The proposed price for the shares
setID
public void setID(int id)
setSize
public void setSize(int size)
setPrice
public void setPrice(int price)
toString
public java.lang.String toString()
- Overrides:
- toString in class java.lang.Object
printInt
public static java.lang.String printInt(int toprint,
int width,
char fill)
- hacks around the lack of printf; stolen from StandardOps.java
in Flight.
printStringRight
public static java.lang.String printStringRight(java.lang.String toprint,
int width,
char fill)
- also hacks printf: this does the equivalent of %-14s
printString
public static java.lang.String printString(java.lang.String toprint,
int width,
char fill)
- also hacks printf: this does the equivalent of %14s
draw
void draw()
name
protected abstract java.lang.String name()