de.upb.swtpra05.group03.shuttle.shared
Class ExtendedOrder

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.shared.ExtendedOrder
All Implemented Interfaces:
PickabackInterface

public class ExtendedOrder
extends java.lang.Object
implements PickabackInterface

Class which is an extension but does not extend the AnOrder class. It is used as an shuttle internal dataholder and contains several information about the status of the order

Version:
$Revision: 1.3 $

Field Summary
private  int billingState
          Indicats the current billing tate of the order
private  int executionState
          Indicats the current execution state of the order
private  int negotiationState
          Indicats the current negotiation state of the order
private  int nextWakeUpTime
          Time value which indicates the next time the order should be updated for any purpose
private  de.upb.swtpra.kernel.message.AnOrder o
          The matching AnOrder object
private  int offerPrice
          The offerPrice for this order
private  int offerSentTime
          The time an offer was sent for the order
private  int orderAvailableTime
          The time an offer was sent for the order
static int PICKABACKIDENTIFIER
          Identifier needed for generating the PickabackString and to recognize this class in a PickabackString
private  int removeTime
          The WakeUpTime on which the order will be removed (if all states are set to DONE)
private  int selfcosts
          The estimated selfcosts for this order
 
Fields inherited from interface de.upb.swtpra05.group03.shuttle.shared.PickabackInterface
MEMBERVARSEPARATOR, OBJECTSEPARATOR
 
Constructor Summary
ExtendedOrder(de.upb.swtpra.kernel.message.AnOrder o)
          Constructor for class ExtendedOrder
ExtendedOrder(de.upb.swtpra.kernel.message.AnOrder o, int negotiationState, int executionState, int billingState)
          Overload for the constructor for class ExtendedOrder
 
Method Summary
static ExtendedOrder createExtendedOrderFromPickaback(java.lang.String s)
          Decodes a previosly encoded ExtendedOrder-Pickabackstring and returns the ExtendedOrder
 int getBillingState()
          Get the billingState attribute of the ExtendedOrder object
 java.lang.String getBillingStateString()
          Gets the billingStateString attribute of the ExtendedOrder object
 int getDestinationTimeLimit()
          Get the destinationTimeLimit attribute of the ExtendedOrder object
 int getDuration()
          Get the duration attribute of the ExtendedOrder object
 int getExecutionState()
          Gets the current execution state
 java.lang.String getExecutionStateString()
          Gets the executionStateString attribute of the ExtendedOrder object
 de.upb.swtpra.kernel.id.OrderID getID()
          Get the iD attribute of the ExtendedOrder object
 int getNegotiationState()
          Get the state attribute of the ExtendedOrder object
 java.lang.String getNegotiationStateString()
          Gets the negotiationStateString attribute of the ExtendedOrder object
 int getNextWakeUpTime()
          Gets the next wakeup time value
 int getOfferPrice()
          Gets the offerPrice value of the order
 int getOfferSentTime()
          Get the offerSentTime attribute of the ExtendedOrder object
 de.upb.swtpra.kernel.message.AnOrder getOrder()
          Get the order attribute of the ExtendedOrder object
 int getOrderAvailableTime()
          Get the orderAvailableTime attribute of the ExtendedOrder object
 int getProfit()
          Get the profit attribute of the ExtendedOrder object
 int getRemoveTime()
           
 int getSelfcosts()
          Gets the estimated selfcosts value of the order
 java.lang.String getStateString(int state)
          Gets the stateString attribute of the ExtendedOrder object
 boolean isDONE()
           
 boolean isFinallyUnassigned(int curTime)
           
 int setBillingState(int newBillingState)
          Sets the billingState attribute of the ExtendedOrder object
 int setExecutionState(int newExecutionState)
          Sets the state attribute of the ExtendedOrder object
 int setNegotiationState(int newNegotiationState)
          Sets the state attribute of the ExtendedOrder object
 void setNextWakeUpTime(int nextWakeUpTime)
          Sets the next wakeup time value
 void setOfferPrice(int offerPrice)
          Sets the offerPrice value of the order
 void setOfferSentTime(int newOfferSentTime)
          Sets the offerSentTime attribute of the ExtendedOrder object
 void setOrderAvailableTime(int newOrderAvailableTime)
          Sets the orderAvailableTime attribute of the ExtendedOrder object
 void setRemoveTime(int timeTillRemoveOrder)
           
 void setSelfcosts(int selfcosts)
          Sets the selfcosts value of the order
 java.lang.String toPickabackString()
          Generates a String representing this class, used for communication with plugin
 void update(ExtendedOrder newExtOrder)
          Updates an existing ExtendOrder with new information from an new instance of for the same AnOrder object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

o

private de.upb.swtpra.kernel.message.AnOrder o
The matching AnOrder object


negotiationState

private int negotiationState
Indicats the current negotiation state of the order


executionState

private int executionState
Indicats the current execution state of the order


billingState

private int billingState
Indicats the current billing tate of the order


offerSentTime

private int offerSentTime
The time an offer was sent for the order


orderAvailableTime

private int orderAvailableTime
The time an offer was sent for the order


nextWakeUpTime

private int nextWakeUpTime
Time value which indicates the next time the order should be updated for any purpose


selfcosts

private int selfcosts
The estimated selfcosts for this order


offerPrice

private int offerPrice
The offerPrice for this order


removeTime

private int removeTime
The WakeUpTime on which the order will be removed (if all states are set to DONE)


PICKABACKIDENTIFIER

public static final int PICKABACKIDENTIFIER
Identifier needed for generating the PickabackString and to recognize this class in a PickabackString

See Also:
Constant Field Values
Constructor Detail

ExtendedOrder

public ExtendedOrder(de.upb.swtpra.kernel.message.AnOrder o)
Constructor for class ExtendedOrder

Parameters:
o - The matching AnOrder object

ExtendedOrder

public ExtendedOrder(de.upb.swtpra.kernel.message.AnOrder o,
                     int negotiationState,
                     int executionState,
                     int billingState)
Overload for the constructor for class ExtendedOrder

Parameters:
o - The matching AnOrder object
negotiationState - The negotiation state
executionState - The execution state
billingState - The billing state
Method Detail

update

public void update(ExtendedOrder newExtOrder)
Updates an existing ExtendOrder with new information from an new instance of for the same AnOrder object

Parameters:
newExtOrder - The new instance of the ExtendeOrder object

toPickabackString

public java.lang.String toPickabackString()
Generates a String representing this class, used for communication with plugin

Returns:
Description of the Return Value

createExtendedOrderFromPickaback

public static ExtendedOrder createExtendedOrderFromPickaback(java.lang.String s)
Decodes a previosly encoded ExtendedOrder-Pickabackstring and returns the ExtendedOrder

Parameters:
s - a string-encoded ExtendedOrder
Returns:
the decoded ExtendedOrder

getNegotiationState

public int getNegotiationState()
Get the state attribute of the ExtendedOrder object

Returns:
The state value

setNegotiationState

public int setNegotiationState(int newNegotiationState)
Sets the state attribute of the ExtendedOrder object

Parameters:
newNegotiationState - The new negotiationState value
Returns:
No description provided

getNegotiationStateString

public java.lang.String getNegotiationStateString()
Gets the negotiationStateString attribute of the ExtendedOrder object

Returns:
The negotiationStateString value

getExecutionState

public int getExecutionState()
Gets the current execution state

Returns:
Constant which identifies the current execution state

setExecutionState

public int setExecutionState(int newExecutionState)
Sets the state attribute of the ExtendedOrder object

Parameters:
newExecutionState - The new executionState value
Returns:
No description provided

getExecutionStateString

public java.lang.String getExecutionStateString()
Gets the executionStateString attribute of the ExtendedOrder object

Returns:
The executionStateString value

getBillingState

public int getBillingState()
Get the billingState attribute of the ExtendedOrder object

Returns:
The billingState value

setBillingState

public int setBillingState(int newBillingState)
Sets the billingState attribute of the ExtendedOrder object

Parameters:
newBillingState - The new billingState value
Returns:
No description provided

getBillingStateString

public java.lang.String getBillingStateString()
Gets the billingStateString attribute of the ExtendedOrder object

Returns:
The billingStateString value

getStateString

public java.lang.String getStateString(int state)
Gets the stateString attribute of the ExtendedOrder object

Parameters:
state - Description of the Parameter
Returns:
The stateString value

isDONE

public boolean isDONE()
Returns:
if all states are DONE

isFinallyUnassigned

public boolean isFinallyUnassigned(int curTime)
Parameters:
curTime -
Returns:
if UNASSIGNED and offeringTime is passed

setOfferSentTime

public void setOfferSentTime(int newOfferSentTime)
Sets the offerSentTime attribute of the ExtendedOrder object

Parameters:
newOfferSentTime - The new offerSentTime value

getOfferSentTime

public int getOfferSentTime()
Get the offerSentTime attribute of the ExtendedOrder object

Returns:
The offerSentTime value

setOrderAvailableTime

public void setOrderAvailableTime(int newOrderAvailableTime)
Sets the orderAvailableTime attribute of the ExtendedOrder object

Parameters:
newOrderAvailableTime - The new orderAvailableTime value

getOrderAvailableTime

public int getOrderAvailableTime()
Get the orderAvailableTime attribute of the ExtendedOrder object

Returns:
The orderAvailableTime value

getOrder

public de.upb.swtpra.kernel.message.AnOrder getOrder()
Get the order attribute of the ExtendedOrder object

Returns:
The order value

getID

public de.upb.swtpra.kernel.id.OrderID getID()
Get the iD attribute of the ExtendedOrder object

Returns:
The iD value

getProfit

public int getProfit()
Get the profit attribute of the ExtendedOrder object

Returns:
The profit value

getDestinationTimeLimit

public int getDestinationTimeLimit()
Get the destinationTimeLimit attribute of the ExtendedOrder object

Returns:
The destinationTimeLimit value

getDuration

public int getDuration()
Get the duration attribute of the ExtendedOrder object

Returns:
The duration value

getNextWakeUpTime

public int getNextWakeUpTime()
Gets the next wakeup time value

Returns:
The next wakeup time

setNextWakeUpTime

public void setNextWakeUpTime(int nextWakeUpTime)
Sets the next wakeup time value

Parameters:
nextWakeUpTime - The new nextWakeUpTime value

getSelfcosts

public int getSelfcosts()
Gets the estimated selfcosts value of the order

Returns:
The selfcosts value

setSelfcosts

public void setSelfcosts(int selfcosts)
Sets the selfcosts value of the order

Parameters:
selfcosts - The new selfcosts value

getOfferPrice

public int getOfferPrice()
Gets the offerPrice value of the order

Returns:
The offerPrice value

setOfferPrice

public void setOfferPrice(int offerPrice)
Sets the offerPrice value of the order

Parameters:
offerPrice - The new offerPrice value

setRemoveTime

public void setRemoveTime(int timeTillRemoveOrder)
Parameters:
timeTillRemoveOrder -

getRemoveTime

public int getRemoveTime()
Returns:
The removeTime value