Class Space

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

public class Space
extends Observable

A location in a warehouse.


Field Summary
protected  int hits
          Number of times this space has been "hit".
protected  Parcel parcel
          Parcel contained in this space.
protected static int totalHits
          Number of spaces "hit" in the course of the simulation.
 
Constructor Summary
Space()
          Constructs a new space.
 
Method Summary
 double getHitPercentage()
          Returns the percentage of total hits that this space has received.
 Parcel getParcel()
          Returns the parcel contained in this space, or null if this space is empty.
 void hit()
          "Hits" this space.
 boolean isEmpty()
          Returns whether or not this space is empty.
 void reset()
          Resets this space.
 void setParcel(Parcel p)
          Sets the parcel contained in this space to the given parcel.
 
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

totalHits

protected static int totalHits
Number of spaces "hit" in the course of the simulation.


hits

protected int hits
Number of times this space has been "hit".


parcel

protected Parcel parcel
Parcel contained in this space.

Constructor Detail

Space

public Space()
Constructs a new space.

Method Detail

reset

public void reset()
Resets this space.


setParcel

public void setParcel(Parcel p)
Sets the parcel contained in this space to the given parcel.

Parameters:
p - the parcel to contain in this space

getParcel

public Parcel getParcel()
Returns the parcel contained in this space, or null if this space is empty.


isEmpty

public boolean isEmpty()
Returns whether or not this space is empty.


hit

public void hit()
"Hits" this space.


getHitPercentage

public double getHitPercentage()
Returns the percentage of total hits that this space has received.