|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectil.ac.tau.cs.software1.set.SimpleSortedSet
public class SimpleSortedSet
A simple implementation of a sorted set. This class is provided as an example and for testing purposes.
Constructor Summary | |
---|---|
SimpleSortedSet(int[] values)
Constructs a new SimpleSortedSet with the given int array as elements of the set the elements of the set are all of type Integer, and are determined at construction of the set. |
Method Summary | |
---|---|
boolean |
contains(java.lang.Integer element)
Returns true if this set contains the specified element. |
java.lang.Integer |
getMaximum()
Returns the maximal (highest) element in this set. |
java.lang.Integer |
getMinimum()
Returns the minimal (lowest) element in this set. |
boolean |
isEmpty()
Returns true if this set contains no elements. |
SortedIterator<java.lang.Integer> |
iterator()
Returns an iterator over the elements of this set. |
static void |
main(java.lang.String[] args)
|
int |
size()
Returns the number of elements in this set (its cardinality). |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleSortedSet(int[] values)
Method Detail |
---|
public int size()
SortedSet
size
in interface SortedSet<java.lang.Integer>
public boolean contains(java.lang.Integer element)
SortedSet
true
if this set contains the specified element.
contains
in interface SortedSet<java.lang.Integer>
true
if this set contains the specified elementpublic boolean isEmpty()
SortedSet
true
if this set contains no elements.
isEmpty
in interface SortedSet<java.lang.Integer>
true
if this set contains no elementspublic java.lang.Integer getMinimum()
SortedSet
getMinimum
in interface SortedSet<java.lang.Integer>
public java.lang.Integer getMaximum()
SortedSet
getMaximum
in interface SortedSet<java.lang.Integer>
public SortedIterator<java.lang.Integer> iterator()
SortedSet
iterator
in interface SortedSet<java.lang.Integer>
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |