|
||||||||||
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>
S
- the transportable class this object is backing.public abstract class AbstractTransportableEntryListBacking<S extends se.sics.isl.transport.Transportable>
This class provides a skeletal implementation of a list of transportables.
The class if backed by an ArrayList
.
Constructor Summary | |
---|---|
protected |
AbstractTransportableEntryListBacking()
Sole constructor. |
Method Summary | |
---|---|
protected int |
addEntry(S entry)
Appends the specified entry to the end of this list. |
protected void |
afterAddEntry(S entry)
Callback that is invoked before the entry is added to the backing list in the removeEntry(int) call. |
protected void |
afterRemoveEntry(int index)
Callback that is invoked after the entry is removed from the backing list in the removeEntry(int) call. |
protected void |
beforeAddEntry(S entry)
Callback that is invoked before the entry is added to the backing list in the removeEntry(int) call. |
protected void |
beforeRemoveEntry(int index)
Callback that is invoked before the entry is removed from the backing list in the removeEntry(int) call. |
protected abstract java.lang.Class |
entryClass()
Returns class of the entries. |
protected java.util.List<S> |
getEntries()
Returns the backing entry list. |
protected S |
getEntry(int index)
Returns the entry at the specified index in this list. |
protected void |
readAfterEntries(se.sics.isl.transport.TransportReader reader)
Reads from the reader after the entry nodes have been read. |
protected void |
readBeforeEntries(se.sics.isl.transport.TransportReader reader)
Reads from the reader before the entry nodes have been read. |
protected void |
readWithLock(se.sics.isl.transport.TransportReader reader)
Reads a list of entry transportables from the reader. |
protected void |
removeEntry(int index)
Removes the entry at the specified index in this list. |
int |
size()
Return the number of entries in the list. |
java.lang.String |
toString()
Returns a string that lists in the form (SimpleName [before] (entry1) ... |
protected void |
toStringAfterEntries(java.lang.StringBuilder builder)
Appends the builder after the entries are written to the builder. |
protected void |
toStringBeforeEntries(java.lang.StringBuilder builder)
Appends the builder before the entries are written to the builder. |
protected void |
writeAfterEntries(se.sics.isl.transport.TransportWriter writer)
Writes to the writer after the entry nodes have been written. |
protected void |
writeBeforeEntries(se.sics.isl.transport.TransportWriter writer)
Writes to the writer before the entry nodes have been written. |
protected void |
writeWithLock(se.sics.isl.transport.TransportWriter writer)
Writes a list of entry transportables to the writer. |
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 |
---|
protected AbstractTransportableEntryListBacking()
Method Detail |
---|
protected final java.util.List<S> getEntries()
public final int size()
protected void toStringBeforeEntries(java.lang.StringBuilder builder)
builder
- the builder to append for the toString()
public final java.lang.String toString()
toString
in class java.lang.Object
protected void toStringAfterEntries(java.lang.StringBuilder builder)
builder
- the builder to append for the toString()
protected void readBeforeEntries(se.sics.isl.transport.TransportReader reader) throws java.text.ParseException
reader
- the reader that is read from.
java.text.ParseException
- if a parse exception occurs before reading in the entries.protected void readAfterEntries(se.sics.isl.transport.TransportReader reader) throws java.text.ParseException
reader
- the reader that is read from.
java.text.ParseException
- if a parse exception occurs after reading in the entries.protected final void readWithLock(se.sics.isl.transport.TransportReader reader) throws java.text.ParseException
readWithLock
in class AbstractTransportable
reader
- the reader to read the data in.
java.text.ParseException
- if a parse exception occurs when reading in the entries.protected final void writeWithLock(se.sics.isl.transport.TransportWriter writer)
writeWithLock
in class AbstractTransportable
writer
- the writer to write the data out to.protected void writeAfterEntries(se.sics.isl.transport.TransportWriter writer)
writer
- the writer that is written to.protected void writeBeforeEntries(se.sics.isl.transport.TransportWriter writer)
writer
- the writer that is written to.protected final S getEntry(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of entry to return
java.lang.IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= size())
.protected final void removeEntry(int index) throws java.lang.IllegalStateException
index
- the index of the element to removed.
java.lang.IllegalStateException
- if the object is lockedprotected void beforeRemoveEntry(int index)
removeEntry(int)
call.
index
- the index to remove.protected void afterRemoveEntry(int index)
removeEntry(int)
call.
index
- the index to remove.protected final int addEntry(S entry) throws java.lang.IllegalStateException
entry
- the entry to be appended to the list
-1
if the entry was not
added.
java.lang.IllegalStateException
- if the object is lockedprotected void beforeAddEntry(S entry) throws java.lang.IllegalStateException
removeEntry(int)
call.
entry
- the entry to be added.
java.lang.IllegalStateException
- if the method is modifying stateprotected void afterAddEntry(S entry) throws java.lang.IllegalStateException
removeEntry(int)
call.
entry
- the entry to be added.
java.lang.IllegalStateException
- if the method is modifying stateprotected abstract java.lang.Class entryClass()
Class.getSimpleName()
simple
name} of the class will determine how the entries are read in by the
TransportReader
. Implementing classes should return the class of
the generic parameter T
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |