|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectup.Index<E>
E
- the type of the index entriespublic class Index<E>
An index for objects. An index maintains a bijective mapping between a set of objects and a contiguous prefix of the non-negative integers. In the context of this mapping, the objects are called index entries and the integers are called index values.
Constructor Summary | |
---|---|
Index()
Constructs an empty index. |
Method Summary | |
---|---|
int |
add(E entry)
Adds the specified entry to this index. |
boolean |
contains(E entry)
Tests whether this index contains the specified entry. |
java.util.List<E> |
getEntries()
Returns the list of all entries of this index. |
E |
getEntry(int index)
Returns the entry with the specified index value. |
int |
getIndex(E entry)
Returns the index value for the specified entry. |
int |
getNEntries()
Returns the number of entries in this index. |
E |
internalize(E entry)
Return the canonical version of the specified entry in this index. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Index()
Method Detail |
---|
public int add(E entry)
entry
- the entry to be added to this index
public E internalize(E entry)
entry
- the entry whose canonical version should be returned
public E getEntry(int index)
index
- the index value of the entry to be returned
null
if this
index does not contain an entry with the specified index valuepublic java.util.List<E> getEntries()
public int getNEntries()
public int getIndex(E entry)
entry
- the entry whose index value should be returned
-1
if
this index does not contain the specified entrypublic boolean contains(E entry)
entry
- the entry whose presence in this index is to be tested
true
if this index contains the specified entry
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |