Package jade.util.leap
Class SortedSetImpl
- java.lang.Object
-
- jade.util.leap.SortedSetImpl
-
- All Implemented Interfaces:
Collection,Set,SortedSet
public class SortedSetImpl extends 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.
-
-
Constructor Summary
Constructors Constructor Description SortedSetImpl()Default Constructor, creates an empty Set, according to the elements' natural order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Object o)Adds an element.Objectfirst()Returns the first (lowest) element currently in this sorted set.booleanisEmpty()Checks if the collection contains elements.Iteratoriterator()Returns an iterator over the elements in this collection.booleanremove(Object o)Removes one instance of the specified element.intsize()Returns the number of elements in this collection.Object[]toArray()Returns an array containing all of the elements in this collection.
-
-
-
Method Detail
-
add
public boolean add(Object o)
Description copied from interface:CollectionAdds an element.- Specified by:
addin interfaceCollection- Returns:
- true if the element has been added.
- See Also:
interface
-
isEmpty
public boolean isEmpty()
Description copied from interface:CollectionChecks if the collection contains elements.- Specified by:
isEmptyin interfaceCollection- Returns:
- true if this collection contains no elements
- See Also:
interface
-
remove
public boolean remove(Object o)
Description copied from interface:CollectionRemoves one instance of the specified element.- Specified by:
removein interfaceCollection- 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:CollectionReturns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned.- Specified by:
iteratorin interfaceCollection- Returns:
- an Iterator over the elements in this collection
- See Also:
interface
-
toArray
public Object[] toArray()
Description copied from interface:CollectionReturns an array containing all of the elements in this collection.- Specified by:
toArrayin interfaceCollection- Returns:
- an array containing all of the elements in this collection
- See Also:
interface
-
size
public int size()
Description copied from interface:CollectionReturns the number of elements in this collection.- Specified by:
sizein interfaceCollection- Returns:
- the number of elements in this collection.
- See Also:
interface
-
-