org.geotools.util
Class KeySortedLinkedList

java.lang.Object
  extended byorg.geotools.util.KeySortedLinkedList

public class KeySortedLinkedList
extends java.lang.Object

List of elements sorted by a key which is not the element itself. Note: this class may change in the future, or by replaced by a TreeMap-based solution.

Author:
Simone Giannecchini

Constructor Summary
KeySortedLinkedList()
           
 
Method Summary
 boolean contains(java.lang.Comparable x)
          Checks if the list contains a certain element, or better its key.
 KeySortedLinkedListIterator find(java.lang.Comparable x)
           
 KeySortedLinkedListIterator findPrevious(java.lang.Comparable x)
           
 KeySortedLinkedListIterator first()
          Retrieves an iterator that points to the first element or to null for an empty list.
 KeySortedLinkedListIterator getAt(int index)
          Returns the object stored at a determined zero-based index in case it exists, null otherwise.
 void insert(java.lang.Comparable x, java.lang.Object o)
          Inserting an element in the list by using a key.
 boolean isEmpty()
          Is the list empty?
 void remove(java.lang.Comparable x)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeySortedLinkedList

public KeySortedLinkedList()
Method Detail

isEmpty

public boolean isEmpty()
Is the list empty?

Returns:
true if the list is empty flase otherwise.

first

public KeySortedLinkedListIterator first()
Retrieves an iterator that points to the first element or to null for an empty list.

Returns:

insert

public void insert(java.lang.Comparable x,
                   java.lang.Object o)
Inserting an element in the list by using a key. In case we already have such a key WE DO NOT replace the old value but we add a new one with the same key!

Parameters:
x - Key to be used to find the right location.
o - Object to be inserted.

contains

public boolean contains(java.lang.Comparable x)
Checks if the list contains a certain element, or better its key.

Parameters:
x -
Returns:

toString

public java.lang.String toString()

find

public KeySortedLinkedListIterator find(java.lang.Comparable x)

findPrevious

public KeySortedLinkedListIterator findPrevious(java.lang.Comparable x)

remove

public void remove(java.lang.Comparable x)

getAt

public KeySortedLinkedListIterator getAt(int index)
Returns the object stored at a determined zero-based index in case it exists, null otherwise.

Parameters:
index -
Returns:


Copyright © GeoTools. All Rights Reserved.