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
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 |
ReferenceList
public ReferenceList()
- Create a new reference list.
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