net.sourceforge.cilib.games.items
Interface ItemLocation

All Superinterfaces:
Cloneable, Serializable, Type
All Known Implementing Classes:
GridLocation

public interface ItemLocation
extends Type

Author:
leo The location of any item in the game

Method Summary
 boolean equals(Object other)
          Compare the specified object with this type for equality.
 ItemLocation getClone()
          Create a cloned copy of the current object and return it.
 double getDistance(DistanceMeasure measure, ItemLocation other)
          Calculate the distance between this location and another one with a specified distance measure
 void moveItem(Type amount)
          Move this location by the specified amount
 
Methods inherited from interface net.sourceforge.cilib.type.types.Type
hashCode
 

Method Detail

getClone

ItemLocation getClone()
Create a cloned copy of the current object and return it. In general the created copy will be a deep copy of the provided instance. As a result this operation an be quite expensive if used incorrectly.

Specified by:
getClone in interface Cloneable
Specified by:
getClone in interface Type
Returns:
An exact clone of the current object instance.
See Also:
Object.clone()

getDistance

double getDistance(DistanceMeasure measure,
                   ItemLocation other)
Calculate the distance between this location and another one with a specified distance measure

Parameters:
measure - The distance measure
other - The other location
Returns:
the distance

moveItem

void moveItem(Type amount)
Move this location by the specified amount

Parameters:
amount -

equals

boolean equals(Object other)
Description copied from interface: Type
Compare the specified object with this type for equality. Returns true if and only if the specified object is also an instance of the same type.

Specified by:
equals in interface Type
Overrides:
equals in class Object
Parameters:
other - The object to compare.
Returns:
true if equality exists, false otherwise.
See Also:
Object.equals(Object)


Copyright © 2009 CIRG. All Rights Reserved.