Class RowsStrategy

java.lang.Object
  |
  +--ACraneStrategy
        |
        +--CenterStrategy
              |
              +--RowsStrategy

public class RowsStrategy
extends CenterStrategy

Strategies that adds parcels to rows with enough contiguous space to hold the whole order.


Field Summary
protected  Point[] addLocations
          Locations found to place a lot of parcels.
protected  int currentParcel
          Current parcel being added.
 
Fields inherited from class ACraneStrategy
crane, warehouse
 
Constructor Summary
RowsStrategy()
           
 
Method Summary
protected  void beginAdd(Order anOrder)
          Finds a row with enough space to hold the given order.
protected  Point getAddLocation(Parcel aParcel)
          Returns the location to add the given parcel, or null if there is no such location.
 String getName()
          Returns the name of this.
 
Methods inherited from class CenterStrategy
getRemoveLocation
 
Methods inherited from class ACraneStrategy
addOrder, 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
 

Field Detail

addLocations

protected Point[] addLocations
Locations found to place a lot of parcels.


currentParcel

protected int currentParcel
Current parcel being added.

Constructor Detail

RowsStrategy

public RowsStrategy()
Method Detail

getName

public String getName()
Returns the name of this.

Overrides:
getName in class CenterStrategy

beginAdd

protected void beginAdd(Order anOrder)
Finds a row with enough space to hold the given order.

Overrides:
beginAdd in class ACraneStrategy
Parameters:
anOrder - order to be added

getAddLocation

protected Point getAddLocation(Parcel aParcel)
Returns the location to add the given parcel, or null if there is no such location.

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