Class HexPath

All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess,

public class HexPath
extends java.util.Vector
implements java.util.List

A List of HexLocation objects.

Note: although the current implementation subclasses Vector, this could change in the future; the List interface is the only one guaranteed to be supported in future versions.

See Also:
Serialized Form

Field Summary
static int MAX_PATH_LENGTH
          the maximum legal HexPath length.
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
Fields inherited from class java.util.AbstractList
Constructor Summary
Method Summary
 boolean add(java.lang.Object location)
          adds a HexLocation object to the end of this HexPath.
 java.lang.String toString()
Methods inherited from class java.util.Vector
add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.List
add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray

Field Detail


public static final int MAX_PATH_LENGTH
the maximum legal HexPath length.

For robustness, HexPath objects will not allow themselves to get arbitrarily long. [This value is currently hardcoded at 1000, but eventually implementations should calculate this value as a function of the maximum allowable BOARD size.]

See Also:
java.lang.List#size(), Constant Field Values
Constructor Detail


public HexPath()
Method Detail


public java.lang.String toString()
toString in class java.util.Vector


public boolean add(java.lang.Object location)
adds a HexLocation object to the end of this HexPath. Note that, for robustness, HexPath objects will not allow themselves to get arbitrarily long.

Specified by:
add in interface java.util.List
add in class java.util.Vector
location - the HexLocation object to add to this path.
java.lang.ClassCastException - if location is not a HexLocation.
E_Unexpected - if this HexPath already has MAX_PATH_LENGTH HexLocations.
See Also: