de.upb.swtpra05.group03.plugin
Class ShuttleStatus

java.lang.Object
  extended byde.upb.swtpra05.group03.plugin.ShuttleStatus

public class ShuttleStatus
extends java.lang.Object

ShuttleStatus is a container class for data concerning a shuttle

Version:
$Revision: 1.3 $

Field Summary
private  int currentLoad
          number of loaded passengers (value = sum of numberOfPassengers of all orders)
private  float margin
          the margin negotiation uses to calculate an offer
private  int maximumLoad
          the maximum number of loaded passengers
private  int maximumStretch
          the maximum stretch of the shuttle
private  int money
          all money the shuttle currently have
private  int stretchSinceLastRepair
          the stretch of the shuttle, counting from zero up to the maximum stretch.
 
Constructor Summary
ShuttleStatus(int mon, int sslr, int cl)
          Constructor for class RemoteShuttleStatusChanged
 
Method Summary
 void clear()
          This method removes all data and resets them all back to zero.
 int getCurrentLoad()
          This method returns the current load of the shuttle.
 float getMargin()
          This method returns the current margin of the shuttle.
 int getMaximumLoad()
          This method returns the maximum load of the shuttle.
 int getMaximumStretch()
          This method returns the maximum stretch of the shuttle.
 int getMoney()
          returns the amount of money the shuttle has
 int getStretch()
          returns the stretch the shuttle has covered since last repair
 boolean getUpdateStatus()
          Returns if the ShuttleStatus is already up to date and should be displayed.
 void setCurrentLoad(int tcurrentLoad)
          This method sets the current load of the shuttle.
 void setMargin(float newMargin)
          This method sets the margin of the shuttle.
 void setMaximumLoad(int tmaximumLoad)
          This method sets the maximum load of the shuttle.
 void setMaximumStretch(int tmaximumStretch)
          This method sets the maximum stretch of the shuttle.
 void setMoney(int tmoney)
          Sets the amount of money the shuttle has
 void setStretch(int newStretchSinceLastRepair)
          Sets the stretch the shuttle has covered since last repair
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stretchSinceLastRepair

private int stretchSinceLastRepair
the stretch of the shuttle, counting from zero up to the maximum stretch.


money

private int money
all money the shuttle currently have


currentLoad

private int currentLoad
number of loaded passengers (value = sum of numberOfPassengers of all orders)


maximumStretch

private int maximumStretch
the maximum stretch of the shuttle


maximumLoad

private int maximumLoad
the maximum number of loaded passengers


margin

private float margin
the margin negotiation uses to calculate an offer

Constructor Detail

ShuttleStatus

public ShuttleStatus(int mon,
                     int sslr,
                     int cl)
Constructor for class RemoteShuttleStatusChanged

Parameters:
mon - money
sslr - stretch
cl - number of loaded passengers
Method Detail

getStretch

public int getStretch()
returns the stretch the shuttle has covered since last repair

Returns:
the stretch the shuttle has covered since last repair

getMoney

public int getMoney()
returns the amount of money the shuttle has

Returns:
the amount of money the shuttle has

getCurrentLoad

public int getCurrentLoad()
This method returns the current load of the shuttle.

Returns:
The current load

getMaximumStretch

public int getMaximumStretch()
This method returns the maximum stretch of the shuttle.

Returns:
The maximum stretch

getMaximumLoad

public int getMaximumLoad()
This method returns the maximum load of the shuttle.

Returns:
The maximum load the shuttle can carry

getMargin

public float getMargin()
This method returns the current margin of the shuttle.

Returns:
The margin value

setStretch

public void setStretch(int newStretchSinceLastRepair)
Sets the stretch the shuttle has covered since last repair

Parameters:
newStretchSinceLastRepair -

setMoney

public void setMoney(int tmoney)
Sets the amount of money the shuttle has

Parameters:
tmoney - Money

setCurrentLoad

public void setCurrentLoad(int tcurrentLoad)
This method sets the current load of the shuttle.

Parameters:
tcurrentLoad - Current load

setMaximumStretch

public void setMaximumStretch(int tmaximumStretch)
This method sets the maximum stretch of the shuttle.

Parameters:
tmaximumStretch - maximum stretch

setMaximumLoad

public void setMaximumLoad(int tmaximumLoad)
This method sets the maximum load of the shuttle.

Parameters:
tmaximumLoad - maximum load

setMargin

public void setMargin(float newMargin)
This method sets the margin of the shuttle.

Parameters:
newMargin - The new margin value

clear

public void clear()
This method removes all data and resets them all back to zero.


getUpdateStatus

public boolean getUpdateStatus()
Returns if the ShuttleStatus is already up to date and should be displayed.

Returns:
true if it is up to date, else false