de.jface.util
Class SortedList

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.ArrayList
                    |
                    +--de.jface.util.SortedList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.io.Serializable

public class SortedList
extends java.util.ArrayList

Class SortedList of project RemotePostIt.

Version:
$Revision: 1.1.1.1 $
Author:
Moritz Petersen
See Also:
Serialized Form

Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
SortedList()
           
 
Method Summary
 java.lang.Object get(java.lang.Object o)
          Returns the given object from the list.
 java.lang.Object get(java.lang.Object o, java.util.Comparator c)
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, remove, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList
 

Constructor Detail

SortedList

public SortedList()
Method Detail

get

public java.lang.Object get(java.lang.Object o)
Returns the given object from the list. The list is looked up using the Collections.binarySearch(List, Object) method. If the list contains an object which returns 0 in the compareTo() method, then the Object that is already stored in the list is returned.

Otherwise the parameter o is inserted into the list so that the order of the list remains intact. Then the same object will be returned.

Parameters:
o - The object that is used to look up the list. Note that the object o and all the objects in the list must implement the Comparable interface. + @return either the parameter, if it doesn't already exist in the list or the instance from the list.
See Also:

get

public java.lang.Object get(java.lang.Object o,
                            java.util.Comparator c)


Copyright © 2002-2002 Moritz Petersen. All Rights Reserved.