com.hedgehog.utility
Class IndexObject<ObjectType>

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.utility.IndexObject<ObjectType>
Type Parameters:
ObjectType - Object type.
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator

public class IndexObject<ObjectType>
extends HObject

Title: IndexObject - represents an object indirectly as an index into a vector of objects.

Description: Represents an object indirectly as an index into a vector of objects.

Copyright: Copyright (c) Hedgehog Software.

Company: Hedgehog Software.

Since:
1.0
Version:
1.1

Field Summary
protected  int mObjectIndex
          Index into vector of objects.
protected  java.util.ArrayList<ObjectType> mObjectVector
          Vector of objects.
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
IndexObject()
          Default constructor.
IndexObject(java.util.ArrayList<ObjectType> objectVector, int objectIndex)
          Constructor.
IndexObject(IndexObject<ObjectType> object)
          Copy constructor.
 
Method Summary
 ObjectType getObject()
          Returns the actual object that the object index refers to.
 int getObjectIndex()
          Returns the obect index.
 java.util.ArrayList<ObjectType> getObjectVector()
          Returns the object vector.
 void setObjectIndex(int objectIndex)
          Sets the object index.
 void setObjectVector(java.util.ArrayList<ObjectType> objectVector)
          Sets the object vector.
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mObjectVector

protected java.util.ArrayList<ObjectType> mObjectVector
Vector of objects.


mObjectIndex

protected int mObjectIndex
Index into vector of objects.

Constructor Detail

IndexObject

public IndexObject()
Default constructor. Sets the object vector to null. Sets the object index to -1.


IndexObject

public IndexObject(java.util.ArrayList<ObjectType> objectVector,
                   int objectIndex)
            throws java.lang.IllegalArgumentException
Constructor.

Parameters:
objectVector - Object vector.
objectIndex - Object index.
Throws:
java.lang.IllegalArgumentException - Thrown if the specified object index is out of range.

IndexObject

public IndexObject(IndexObject<ObjectType> object)
Copy constructor.

Parameters:
object - Object to copy.
Method Detail

getObjectVector

public java.util.ArrayList<ObjectType> getObjectVector()
Returns the object vector.

Returns:
The object vector.

getObjectIndex

public int getObjectIndex()
Returns the obect index.

Returns:
The obect index.

setObjectVector

public void setObjectVector(java.util.ArrayList<ObjectType> objectVector)
Sets the object vector.

Parameters:
objectVector - New object vector.

setObjectIndex

public void setObjectIndex(int objectIndex)
Sets the object index.

Parameters:
objectIndex - New object index.

getObject

public ObjectType getObject()
Returns the actual object that the object index refers to.

Returns:
The the actual object referred to.