| org.zkoss.util.ListX
All known Subclasses: org.zkoss.util.TreeArray,
ListX | public interface ListX (Code) | | 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.
author: tomyeh See Also: TreeArray |
Inner Class :public interface Entry | |
Method Summary | |
public Entry | addEntry(Entry insertBefore, Object element) Inserts the sepcified element in front of the specified entry. | public Entry | addEntry(int index, Object element) Inserts the specified element at the specified position in this list.
It is an enhanced version of List.add -- it returns the entry
containing the element.
Parameters: index - index at which the specified element is to be inserted. Parameters: element - element to be inserted. | public Entry | addEntry(Object element) Appends the specified element to the end of this list.
It is an enhanced version of List.add -- it returns the entry
containing the element.
Parameters: element - the element to be inserted. | public Entry | getEntry(int index) Gets the entry of the specified index, rather than the element
added by List.add. | public int | indexOfEntry(Entry entry) Gets the index of the specified entry. | public void | removeEntry(Entry entry) Remove the entry from the list. | public Entry | removeEntry(int index) Remove the entry at the specified location from the list. |
addEntry | public Entry addEntry(Entry insertBefore, Object element)(Code) | | Inserts the sepcified element in front of the specified entry.
Shifts the element currently at that position (if any)
and any subsequent elements to the right (adds one to their indices).
Parameters: insertBefore - the entry before which an new entry will beinserted; append is assumed if null Parameters: element - the element to insert the new entry containing the inserted element. |
addEntry | public Entry addEntry(int index, Object element)(Code) | | Inserts the specified element at the specified position in this list.
It is an enhanced version of List.add -- it returns the entry
containing the element.
Parameters: index - index at which the specified element is to be inserted. Parameters: element - element to be inserted. the new entry that conatining the inserted element. |
addEntry | public Entry addEntry(Object element)(Code) | | Appends the specified element to the end of this list.
It is an enhanced version of List.add -- it returns the entry
containing the element.
Parameters: element - the element to be inserted. the new entry that conatining the inserted element. |
getEntry | public Entry getEntry(int index)(Code) | | Gets the entry of the specified index, rather than the element
added by List.add. An entry is an internal representation of an
object that holding the element stored by List.add.
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.
Parameters: index - the index from which the entry is retrieved the entry |
indexOfEntry | public int indexOfEntry(Entry entry)(Code) | | Gets the index of the specified entry.
Parameters: entry - the entry to locate the index; -1 if entry is orphan |
removeEntry | public void removeEntry(Entry entry)(Code) | | Remove the entry from the list. The entry object does not
be deleted, and it is just no longer referenced by the list.
Parameters: entry - the entry returned by getEntry. |
removeEntry | public Entry removeEntry(int index)(Code) | | Remove the entry at the specified location from the list.
Unlike List.remove(int), it returns the entry being removed.
Parameters: index - the location of the entry to remove the entry being removed |
|
|