Class CenterStrategy

java.lang.Object
  |
  +--ACraneStrategy
        |
        +--CenterStrategy
Direct Known Subclasses:
RowsStrategy

public class CenterStrategy
extends ACraneStrategy

Strategy that picks locations near the center of the warehouse.


Field Summary
 
Fields inherited from class ACraneStrategy
crane, warehouse
 
Constructor Summary
CenterStrategy()
           
 
Method Summary
protected  Point getAddLocation(Parcel aParcel)
          Returns an empty location near the center of the warehouse, or returns null if there are no empty locations.
 String getName()
          Returns the name of this.
protected  Point getRemoveLocation(Order anOrder)
          Returns a location near the center of the warehouse that contains a parcel in the given lot, or returns null if there are no parcels in the given order.
 
Methods inherited from class ACraneStrategy
addOrder, beginAdd, beginRemove, installInto, orderNumberAt, parcelAdded, parcelPlacedAt, parcelRemoved, parcelRemovedFrom, quit, removeOrder, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CenterStrategy

public CenterStrategy()
Method Detail

getName

public String getName()
Returns the name of this.

Specified by:
getName in class ACraneStrategy

getAddLocation

protected Point getAddLocation(Parcel aParcel)
Returns an empty location near the center of the warehouse, or returns null if there are no empty locations.

Overrides:
getAddLocation in class ACraneStrategy
Parameters:
aParcel - parcel to add

getRemoveLocation

protected Point getRemoveLocation(Order anOrder)
Returns a location near the center of the warehouse that contains a parcel in the given lot, or returns null if there are no parcels in the given order.

Overrides:
getRemoveLocation in class ACraneStrategy
Parameters:
anOrder - order to remove