Class Order
- java.lang.Object
-
- jadex.bdi.examples.booktrading.common.Order
-
public class Order extends java.lang.ObjectThe order for purchasing or selling books.
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanbuyorderThe flag indicating if it is a buy (or sell) order.protected IClockServiceclockThe clock.protected java.util.DatedeadlineThe deadline.static java.lang.StringDONEThe state done.protected java.util.DateexedateThe execution date.protected java.lang.IntegerexepriceThe execution price.static java.lang.StringFAILEDThe state failed.protected intlimitThe limit price.static java.lang.StringOPENThe state open.SimplePropertyChangeSupportpcsThe helper object for bean events.protected intstartpriceThe startprice.protected longstarttimeThe starttime.protected java.lang.StringstateThe state.protected java.lang.StringtitleThe book title.
-
Constructor Summary
Constructors Constructor Description Order(java.lang.String title, java.util.Date deadline, int start, int limit, boolean buyorder, IClockService clock)Create a new order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPropertyChangeListener(PropertyChangeListener listener)Add a PropertyChangeListener to the listener list.java.util.DategetDeadline()Get the deadline.java.util.DategetExecutionDate()Get the execution date.java.lang.IntegergetExecutionPrice()Get the execution price.intgetLimit()Get the limit.intgetStartPrice()Getter for startpricelonggetStartTime()Get the start time.java.lang.StringgetState()Get the order state.java.lang.StringgetTitle()Get the title.booleanisBuyOrder()Test if it is a buyorder.voidremovePropertyChangeListener(PropertyChangeListener listener)Remove a PropertyChangeListener from the listener list.voidsetBuyOrder(boolean buyorder)Set the order type.voidsetDeadline(java.util.Date deadline)Set the deadline.voidsetExecutionDate(java.util.Date exedate)Set the execution date.voidsetExecutionPrice(java.lang.Integer exeprice)Set the execution price.voidsetLimit(int limit)Set the limit.voidsetStartPrice(int startprice)Setter for startprice.voidsetStartTime(long starttime)Set the start time.voidsetState(java.lang.String state)Set the state.voidsetTitle(java.lang.String title)Set the title.java.lang.StringtoString()Get a string representation of the order.
-
-
-
Field Detail
-
OPEN
public static final java.lang.String OPEN
The state open.- See Also:
- Constant Field Values
-
DONE
public static final java.lang.String DONE
The state done.- See Also:
- Constant Field Values
-
FAILED
public static final java.lang.String FAILED
The state failed.- See Also:
- Constant Field Values
-
title
protected java.lang.String title
The book title.
-
deadline
protected java.util.Date deadline
The deadline.
-
limit
protected int limit
The limit price.
-
startprice
protected int startprice
The startprice.
-
starttime
protected long starttime
The starttime.
-
exeprice
protected java.lang.Integer exeprice
The execution price.
-
exedate
protected java.util.Date exedate
The execution date.
-
buyorder
protected boolean buyorder
The flag indicating if it is a buy (or sell) order.
-
state
protected java.lang.String state
The state.
-
clock
protected IClockService clock
The clock.
-
pcs
public SimplePropertyChangeSupport pcs
The helper object for bean events.
-
-
Constructor Detail
-
Order
public Order(java.lang.String title, java.util.Date deadline, int start, int limit, boolean buyorder, IClockService clock)Create a new order.- Parameters:
title- The title.deadline- The deadline.limit- The limit.start- The start price
-
-
Method Detail
-
getTitle
public java.lang.String getTitle()
Get the title.- Returns:
- The title.
-
setTitle
public void setTitle(java.lang.String title)
Set the title.- Parameters:
title- The title.
-
getDeadline
public java.util.Date getDeadline()
Get the deadline.- Returns:
- The deadline.
-
setDeadline
public void setDeadline(java.util.Date deadline)
Set the deadline.- Parameters:
deadline- The deadline.
-
getLimit
public int getLimit()
Get the limit.- Returns:
- The limit.
-
setLimit
public void setLimit(int limit)
Set the limit.- Parameters:
limit- The limit.
-
getStartPrice
public int getStartPrice()
Getter for startprice- Returns:
- Returns startprice.
-
setStartPrice
public void setStartPrice(int startprice)
Setter for startprice.- Parameters:
startprice- The Order.java value to set
-
getStartTime
public long getStartTime()
Get the start time.- Returns:
- The start time.
-
setStartTime
public void setStartTime(long starttime)
Set the start time.- Parameters:
starttime- The start time.
-
getExecutionPrice
public java.lang.Integer getExecutionPrice()
Get the execution price.- Returns:
- The execution price.
-
setExecutionPrice
public void setExecutionPrice(java.lang.Integer exeprice)
Set the execution price.- Parameters:
exeprice- The execution price.
-
getExecutionDate
public java.util.Date getExecutionDate()
Get the execution date.- Returns:
- The execution date.
-
setExecutionDate
public void setExecutionDate(java.util.Date exedate)
Set the execution date.- Parameters:
exedate- The execution date.
-
isBuyOrder
public boolean isBuyOrder()
Test if it is a buyorder.- Returns:
- True, if buy order.
-
setBuyOrder
public void setBuyOrder(boolean buyorder)
Set the order type.- Parameters:
buyorder- True for buyorder.
-
getState
public java.lang.String getState()
Get the order state.- Returns:
- The order state.
-
setState
public void setState(java.lang.String state)
Set the state.- Parameters:
state- The state.
-
toString
public java.lang.String toString()
Get a string representation of the order.- Overrides:
toStringin classjava.lang.Object
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list. The listener is registered for all properties.- Parameters:
listener- The PropertyChangeListener to be added.
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.- Parameters:
listener- The PropertyChangeListener to be removed.
-
-