public class SortedSetImpl extends java.lang.Object implements SortedSet
SortedSet
,
TreeSet
Constructor and Description |
---|
SortedSetImpl()
Default Constructor, creates an empty Set,
according to the elements' natural order.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public SortedSetImpl()
public boolean add(java.lang.Object o)
Collection
add
in interface Collection
interface
public boolean isEmpty()
Collection
isEmpty
in interface Collection
interface
public boolean remove(java.lang.Object o)
Collection
remove
in interface Collection
o
- the element to be removedinterface
public Iterator iterator()
Collection
iterator
in interface Collection
interface
public java.lang.Object[] toArray()
Collection
toArray
in interface Collection
interface
public int size()
Collection
size
in interface Collection
interface