edu.umd.cfar.lamp.viper.geometry
Class AbstractMoveable

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.geometry.AbstractMoveable
All Implemented Interfaces:
Moveable

public abstract class AbstractMoveable
extends java.lang.Object
implements Moveable

Implements the 'move' method using the 'shift' method.


Field Summary
 
Fields inherited from interface edu.umd.cfar.lamp.viper.geometry.Moveable
EAST, NORTH, NORTHEAST, NORTHWEST, SOUTH, SOUTHEAST, SOUTHWEST, WEST
 
Constructor Summary
AbstractMoveable()
           
 
Method Summary
 Moveable move(int direction, int distance)
          Gets a copy of the box, shifted by the given amount in the specified direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.umd.cfar.lamp.viper.geometry.Moveable
shift
 

Constructor Detail

AbstractMoveable

public AbstractMoveable()
Method Detail

move

public Moveable move(int direction,
                     int distance)
Gets a copy of the box, shifted by the given amount in the specified direction.

Specified by:
move in interface Moveable
Parameters:
direction - the direction to remove the box, e.g. Moveable.NORTH
distance - the distance to move the box
Returns:
a new box, that is a copy of this box, shifted as specified