one.util
Class ReferenceList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--one.util.ReferenceList
All Implemented Interfaces:
Cloneable, Collection, List, Serializable

public class ReferenceList
extends ArrayList

Implementation of a reference list. A reference list is an ordered list of objects or, more precisely, object references where a particular object reference appears in the list at most once. This class simply provides the minimal necessary functionality to implement such a reference list on top of an array list. However, it does not enforce the invariant that a particular object reference should appear in a reference list at most once.

Version:
1.0
See Also:
Serialized Form

Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ReferenceList()
          Create a new reference list.
 
Method Summary
 int find(Object o)
          Determine the index of the specified object within this reference list.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

ReferenceList

public ReferenceList()
Create a new reference list.
Method Detail

find

public int find(Object o)
Determine the index of the specified object within this reference list. Uses == to compare the specified object against the objects in this reference list. The list is searched starting from index 0.
Parameters:
o - The object to search for.
Returns:
The index of the specified object within this reference list, or -1 if the object does not appear in this reference list.


(C) Copyright 2001 UW CSE