Class Statistics

java.lang.Object
  |
  +--java.util.Observable
        |
        +--Statistics

public class Statistics
extends Observable

Operating statistics for a warehouse crane.


Field Summary
protected  int adds
          Number of orders successfully added.
protected  int failedAdds
          Number of orders unsuccessfully added.
protected  int failedRemoves
          Number of orders unsuccessfully removed.
protected  int fragmented
          Number of fragmented orders.
protected  int moves
          Number of spaces moved.
protected  int removes
          Number of orders successfully removed.
protected  long time
          Number of milliseconds used by strategy.
 
Constructor Summary
Statistics()
           
 
Method Summary
 void add(Statistics s)
          Adds the given statistics to this set of statistics.
 void addTime(long ms)
          Adds the given number of milliseconds.
 int getAdds()
          Returns the number of added orders.
 int getFailedAdds()
          Returns the number of failed adds.
 int getFailedRemoves()
          Returns the number of failed removes.
 int getFragmented()
          Returns the number of fragmented orders.
 int getMoves()
          Returns the number of crane moves.
 int getRemoves()
          Returns the number of removed orders.
 long getTime()
          Returns the number of milliseconds used by the strategy.
 void incrementAdds()
          Adds one to the number of added orders.
 void incrementFailedAdds()
          Adds one to the number of failed adds.
 void incrementFailedRemoves()
          Adds one to the number of failed removes.
 void incrementFragmented()
          Adds one to the number of fragmented orders.
 void incrementMoves()
          Adds one to the number of crane moves.
 void incrementRemoves()
          Adds one to the number of removed orders.
 void reset()
          Resets all metrics to zero.
protected  void update()
          Notifies observers that this object has changed.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

moves

protected int moves
Number of spaces moved.


adds

protected int adds
Number of orders successfully added.


fragmented

protected int fragmented
Number of fragmented orders.


failedAdds

protected int failedAdds
Number of orders unsuccessfully added.


removes

protected int removes
Number of orders successfully removed.


failedRemoves

protected int failedRemoves
Number of orders unsuccessfully removed.


time

protected long time
Number of milliseconds used by strategy.

Constructor Detail

Statistics

public Statistics()
Method Detail

reset

public void reset()
Resets all metrics to zero.


incrementMoves

public void incrementMoves()
Adds one to the number of crane moves.


getMoves

public int getMoves()
Returns the number of crane moves.


incrementAdds

public void incrementAdds()
Adds one to the number of added orders.


getAdds

public int getAdds()
Returns the number of added orders.


incrementFailedAdds

public void incrementFailedAdds()
Adds one to the number of failed adds.


getFailedAdds

public int getFailedAdds()
Returns the number of failed adds.


incrementFragmented

public void incrementFragmented()
Adds one to the number of fragmented orders.


getFragmented

public int getFragmented()
Returns the number of fragmented orders.


incrementRemoves

public void incrementRemoves()
Adds one to the number of removed orders.


getRemoves

public int getRemoves()
Returns the number of removed orders.


incrementFailedRemoves

public void incrementFailedRemoves()
Adds one to the number of failed removes.


getFailedRemoves

public int getFailedRemoves()
Returns the number of failed removes.


addTime

public void addTime(long ms)
Adds the given number of milliseconds.


getTime

public long getTime()
Returns the number of milliseconds used by the strategy.


add

public void add(Statistics s)
Adds the given statistics to this set of statistics.


update

protected void update()
Notifies observers that this object has changed.