org.inria.ns.reflex.util
Class SortedList

java.lang.Object
  extended by org.inria.ns.reflex.util.SortedList

public class SortedList
extends Object

A list that may contains duplicate items (according to their natural comparator). This implementation can be used for tiny lists only.

Author:
Philippe Poulard

Constructor Summary
SortedList()
           
 
Method Summary
 void add(Comparable item)
          Inserts the specified item at its natural position in this list.
 Iterator iterator()
          Return an iterator on this list.
 int size()
          Return the size of this collection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedList

public SortedList()
Method Detail

size

public int size()
Return the size of this collection.

Returns:
The size of this collection.

add

public void add(Comparable item)
Inserts the specified item at its natural position in this list.

Parameters:
item - The item to add, that must be a comparable item.

iterator

public Iterator iterator()
Return an iterator on this list.