Class Order
- java.lang.Object
-
- jadex.bdiv3.examples.booktrading.common.Order
-
public class Order extends java.lang.Object
The order for purchasing or selling books.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
buyorder
The flag indicating if it is a buy (or sell) order.protected IClockService
clock
The clock.protected java.util.Date
deadline
The deadline.static java.lang.String
DONE
The state done.protected java.util.Date
exedate
The execution date.protected java.lang.Integer
exeprice
The execution price.static java.lang.String
FAILED
The state failed.protected int
limit
The limit price.static java.lang.String
OPEN
The state open.SimplePropertyChangeSupport
pcs
The helper object for bean events.protected int
startprice
The startprice.protected long
starttime
The starttime.protected java.lang.String
state
The state.protected java.lang.String
title
The 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 void
addPropertyChangeListener(PropertyChangeListener listener)
Add a PropertyChangeListener to the listener list.java.util.Date
getDeadline()
Get the deadline.java.util.Date
getExecutionDate()
Get the execution date.java.lang.Integer
getExecutionPrice()
Get the execution price.int
getLimit()
Get the limit.int
getStartPrice()
Getter for startpricelong
getStartTime()
Get the start time.java.lang.String
getState()
Get the order state.java.lang.String
getTitle()
Get the title.boolean
isBuyOrder()
Test if it is a buyorder.void
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.void
setBuyOrder(boolean buyorder)
Set the order type.void
setDeadline(java.util.Date deadline)
Set the deadline.void
setExecutionDate(java.util.Date exedate)
Set the execution date.void
setExecutionPrice(java.lang.Integer exeprice)
Set the execution price.void
setLimit(int limit)
Set the limit.void
setStartPrice(int startprice)
Setter for startprice.void
setStartTime(long starttime)
Set the start time.void
setState(java.lang.String state)
Set the state.void
setTitle(java.lang.String title)
Set the title.java.lang.String
toString()
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:
toString
in 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.
-
-