|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ListX
The extended list interface. It provides methods to access the entry of each node in the list.
Any class implementing this interface guarantees the binding between the entry and the element never changes even after removed.
TreeArray
Nested Class Summary | |
---|---|
static interface |
ListX.Entry
Represents the entry of each node in the list. |
Method Summary | |
---|---|
ListX.Entry |
addEntry(int index,
java.lang.Object element)
Inserts the specified element at the specified position in this list. |
ListX.Entry |
addEntry(ListX.Entry insertBefore,
java.lang.Object element)
Inserts the sepcified element in front of the specified entry. |
ListX.Entry |
addEntry(java.lang.Object element)
Appends the specified element to the end of this list. |
ListX.Entry |
getEntry(int index)
Gets the entry of the specified index, rather than the element added by List.add. |
int |
indexOfEntry(ListX.Entry entry)
Gets the index of the specified entry. |
ListX.Entry |
removeEntry(int index)
Remove the entry at the specified location from the list. |
void |
removeEntry(ListX.Entry entry)
Remove the entry from the list. |
Method Detail |
---|
ListX.Entry getEntry(int index)
The caller should consider the returned entry as opaque. The caller could store it for later use. It is useful when you want to extend the list's features, such as providing two or more indexing methods.
In other words, even if the underlying structure of a list is changed (e.g., a new element is inserted), the caller holding entries won't be affected.
index
- the index from which the entry is retrieved
int indexOfEntry(ListX.Entry entry)
entry
- the entry to locate
ListX.Entry addEntry(ListX.Entry insertBefore, java.lang.Object element)
Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
insertBefore
- the entry before which an new entry will be
inserted; append is assumed if nullelement
- the element to insert
ListX.Entry addEntry(int index, java.lang.Object element)
index
- index at which the specified element is to be inserted.element
- element to be inserted.
ListX.Entry addEntry(java.lang.Object element)
element
- the element to be inserted.
void removeEntry(ListX.Entry entry)
entry
- the entry returned by getEntry.ListX.Entry removeEntry(int index)
index
- the location of the entry to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |