public class SortedSetImpl extends Object implements SortedSet
Constructor and Description |
---|
SortedSetImpl()
Default Constructor, creates an empty Set,
according to the elements' natural order.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object o)
Adds an element.
|
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(Object o)
Removes one instance of the specified element.
|
int |
size()
Returns the number of elements in this collection.
|
Object[] |
toArray()
Returns an array containing all of the elements in this collection.
|
private TreeSet hiddenSet
public SortedSetImpl()
public boolean add(Object o)
Collection
add
in interface Collection
interface
public boolean isEmpty()
Collection
isEmpty
in interface Collection
interface
public boolean remove(Object o)
Collection
remove
in interface Collection
o
- the element to be removedinterface
public Iterator iterator()
Collection
iterator
in interface Collection
interface
public Object[] toArray()
Collection
toArray
in interface Collection
interface
public int size()
Collection
size
in interface Collection
interface