jade.util.leap
Class SortedSetImpl

java.lang.Object
  |
  +--jade.util.leap.SortedSetImpl
All Implemented Interfaces:
Collection, Set, SortedSet

public class SortedSetImpl
extends java.lang.Object
implements SortedSet

The LEAP (environment-dependent) implementation of the &qote;SortedSet&qote; interface. This class appears to be exactly the same in J2SE, PJAVA and MIDP. The internal implementation is different in the three cases however.

Version:
1.0, 20/10/00
Author:
Nicolas Lhuillier
See Also:
SortedSet, TreeSet

Constructor Summary
SortedSetImpl()
          Default Constructor, creates an empty Set, according to the elements' natural order.
 
Method Summary
 boolean add(java.lang.Object o)
          Adds an element.
 java.lang.Object first()
          Returns the first (lowest) element currently in this sorted set.
 boolean isEmpty()
          Checks if the collection contains elements.
 Iterator iterator()
          Returns an iterator over the elements in this collection.
 boolean remove(java.lang.Object o)
          Removes one instance of the specified element.
 int size()
          Returns the number of elements in this collection.
 java.lang.Object[] toArray()
          Returns an array containing all of the elements in this collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortedSetImpl

public SortedSetImpl()
Default Constructor, creates an empty Set, according to the elements' natural order.

Method Detail

add

public boolean add(java.lang.Object o)
Description copied from interface: Collection
Adds an element.

Specified by:
add in interface Collection
Returns:
true if the element has been added.
See Also:
interface

isEmpty

public boolean isEmpty()
Description copied from interface: Collection
Checks if the collection contains elements.

Specified by:
isEmpty in interface Collection
Returns:
true if this collection contains no elements
See Also:
interface

remove

public boolean remove(java.lang.Object o)
Description copied from interface: Collection
Removes one instance of the specified element.

Specified by:
remove in interface Collection
Parameters:
o - the element to be removed
Returns:
true if the element has been removed
See Also:
interface

iterator

public Iterator iterator()
Description copied from interface: Collection
Returns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned.

Specified by:
iterator in interface Collection
Returns:
an Iterator over the elements in this collection
See Also:
interface

toArray

public java.lang.Object[] toArray()
Description copied from interface: Collection
Returns an array containing all of the elements in this collection.

Specified by:
toArray in interface Collection
Returns:
an array containing all of the elements in this collection
See Also:
interface

size

public int size()
Description copied from interface: Collection
Returns the number of elements in this collection.

Specified by:
size in interface Collection
Returns:
the number of elements in this collection.
See Also:
interface

first

public java.lang.Object first()
Description copied from interface: SortedSet
Returns the first (lowest) element currently in this sorted set.

Specified by:
first in interface SortedSet
Returns:
the first (lowest) element currently in this sorted set.
See Also:
interface


JADE