|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umich.eecs.tac.props.AbstractTransportable edu.umich.eecs.tac.props.AbstractTransportableEntryListBacking<S> edu.umich.eecs.tac.props.AbstractKeyedEntryList<T,S>
T
- key classS
- entry classpublic abstract class AbstractKeyedEntryList<T,S extends KeyedEntry<T>>
This class provides a skeletal implementation of a list containing
keyed entries
with supporting
methods for interacting entries specified by a given key.
Constructor Summary | |
---|---|
AbstractKeyedEntryList()
|
Method Summary | |
---|---|
protected int |
addKey(T key)
Adds a new key to the list. |
boolean |
containsKey(T key)
Returns true if the key is in the list and
false otherwise. |
protected abstract S |
createEntry(T key)
Creates a new entry with the given key. |
protected S |
getEntry(T key)
Returns the entry with the specified key. |
protected T |
getKey(int index)
Returns the key for the entry at the index . |
int |
indexForEntry(T key)
Returns the index for the entry specified by the key. |
java.util.Iterator<T> |
iterator()
Returns an iterator over the keys in the list. |
java.util.Set<T> |
keys()
Returns the set of keys for the entries. |
Methods inherited from class edu.umich.eecs.tac.props.AbstractTransportableEntryListBacking |
---|
addEntry, afterAddEntry, afterRemoveEntry, beforeAddEntry, beforeRemoveEntry, entryClass, getEntries, getEntry, readAfterEntries, readBeforeEntries, readWithLock, removeEntry, size, toString, toStringAfterEntries, toStringBeforeEntries, writeAfterEntries, writeBeforeEntries, writeWithLock |
Methods inherited from class edu.umich.eecs.tac.props.AbstractTransportable |
---|
getTransportName, isLocked, lock, lockCheck, read, write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractKeyedEntryList()
Method Detail |
---|
public final int indexForEntry(T key)
key
- the key for the entry to be found.
-1
if the key
is not in the list.public final java.util.Iterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
public final boolean containsKey(T key)
true
if the key is in the list and
false
otherwise.
key
- the key to check for containment.
true
if the key is in the list and false
otherwise.protected final int addKey(T key) throws java.lang.NullPointerException
createEntry(T)
method creates the
new entry with the specified key.
key
- the key used to add the new entry.
java.lang.NullPointerException
- if the key
is null
.protected abstract S createEntry(T key)
key
- the key for the created entry.
public final java.util.Set<T> keys()
protected final T getKey(int index) throws java.lang.IndexOutOfBoundsException
index
.
index
- the index for the entry.
index
.
java.lang.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size()).protected final S getEntry(T key)
key
- the key used to identify the entry.
null
if the key is not found.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |