| java.util.AbstractSequentialList org.geotools.util.KeySortedList
KeySortedList | public class KeySortedList extends AbstractSequentialList implements Serializable(Code) | | List of elements sorted by a key which is not the element itself.
since: 2.2 version: $Id: KeySortedList.java 22443 2006-10-27 20:47:22Z desruisseaux $ author: Simone Giannecchini author: Martin Desruisseaux |
Constructor Summary | |
public | KeySortedList() Creates a new, initially empty list. |
Method Summary | |
public void | add(Comparable key, Object element) Inserts the specified element at a position determined by the specified key. | public void | clear() Removes all of the elements from this list. | public boolean | containsKey(Comparable key) Returns
true if the list contains an element
with the specified key. | public int | count(Comparable key) Returns the number of elements
with the specified
key. | public Object | first(Comparable key) Returns the first element
with the specified key.
Parameters: key - The key for the element to search for. | public KeySortedList | headList(Comparable toKey) Returns a view of the portion of this list whose keys are strictly less than
toKey .
The returned list is backed by this list, so changes in the returned list are reflected in
this list, and vice-versa.
Parameters: toKey - high endpoint (exclusive) of the sub list. | public Object | last(Comparable key) Returns the last element
with the specified key.
Parameters: key - The key for the element to search for. | public ListIterator | listIterator(Comparable fromKey) Returns a list iterator of the elements in this list (in proper sequence), starting
at the elements
with the specified key.
Parameters: fromKey - The key of the first element to returns. | public ListIterator | listIterator(int index) Returns a list iterator of the elements in this list (in proper sequence), starting at the
specified position. | public int | removeAll(Comparable key) Removes all values that were
with the specified
key. | public int | size() Returns the number of elements in this list. | public KeySortedList | tailList(Comparable fromKey) Returns a view of the portion of this list whose keys are greater than or equal to
fromKey . |
KeySortedList | public KeySortedList()(Code) | | Creates a new, initially empty list.
|
add | public void add(Comparable key, Object element)(Code) | | Inserts the specified element at a position determined by the specified key. If some
elements were already inserted for the specified key, then this method do not replaces
the old value (like what a
Map would do), but instead add the new element with
the same key.
Parameters: key - Key to be used to find the right location. Parameters: element - Object to be inserted. |
clear | public void clear()(Code) | | Removes all of the elements from this list.
|
containsKey | public boolean containsKey(Comparable key)(Code) | | Returns
true if the list contains an element
with the specified key. This is equivalent to testing
(key) != 0 .
|
count | public int count(Comparable key)(Code) | | Returns the number of elements
with the specified
key.
|
headList | public KeySortedList headList(Comparable toKey)(Code) | | Returns a view of the portion of this list whose keys are strictly less than
toKey .
The returned list is backed by this list, so changes in the returned list are reflected in
this list, and vice-versa.
Parameters: toKey - high endpoint (exclusive) of the sub list. A view of the specified initial range of this list. |
listIterator | public ListIterator listIterator(Comparable fromKey)(Code) | | Returns a list iterator of the elements in this list (in proper sequence), starting
at the elements
with the specified key.
Parameters: fromKey - The key of the first element to returns. A list iterator of the elements in this list (in proper sequence). throws: IndexOutOfBoundsException - if the index is out of range. |
listIterator | public ListIterator listIterator(int index)(Code) | | Returns a list iterator of the elements in this list (in proper sequence), starting at the
specified position. The specified index indicates the first element that would be returned
by an initial call to the
ListIterator.next next() method.
Parameters: index - Index of first element to be returned from the list iterator. A list iterator of the elements in this list (in proper sequence). throws: IndexOutOfBoundsException - if the index is out of range. |
removeAll | public int removeAll(Comparable key)(Code) | | Removes all values that were
with the specified
key. Returns the number of elements removed.
|
size | public int size()(Code) | | Returns the number of elements in this list.
|
tailList | public KeySortedList tailList(Comparable fromKey)(Code) | | Returns a view of the portion of this list whose keys are greater than or equal to
fromKey . The returned list is backed by this list, so changes in the returned
list are reflected in this list, and vice-versa.
Parameters: fromKey - low endpoint (inclusive) of the sub list. A view of the specified final range of this list. |
|
|