|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IntSet
Title:
Description: An interface describing a set of primitive integers. An implementation may only accept certain types of integers (e.g. only positive integers).
Copyright: Copyright (c) 2007
Company: Clark & Parsia, LLC.
Method Summary | |
---|---|
void |
add(int value)
Adds a new integer to this set. |
void |
addAll(IntSet other)
Adds all the integers from another set to this set. |
boolean |
contains(int value)
Checks if the given integer value is in this set. |
IntSet |
copy()
Creates a copy of this set. |
boolean |
isEmpty()
Cehcks if the set is empty. |
IntIterator |
iterator()
An iterator over the values of this set. |
int |
max()
Returns the maximum integer in this set. |
int |
min()
Returns the minimum integer in this set. |
void |
remove(int value)
Remove the given integer value from this set. |
int |
size()
Returns the number of elements in the set. |
IntSet |
union(IntSet set)
Creates a new IntSet that is the union of this set and the given set. |
Method Detail |
---|
void add(int value) throws java.lang.IllegalArgumentException
value
- integer value to be added
java.lang.IllegalArgumentException
- if the value is not supported by this set implementationvoid addAll(IntSet other)
other
- the set whose elements will be added
java.lang.IllegalArgumentException
- if any of the values in the other set is not supported by
this set implementationboolean contains(int value)
value
- the integer value being checked
true
if the value is in this setIntSet copy()
boolean isEmpty()
true
if there are no elements in the setIntIterator iterator()
int max() throws java.util.NoSuchElementException
java.util.NoSuchElementException
- if the set is emptyint min()
java.util.NoSuchElementException
- if the set is emptyvoid remove(int value)
value
- the integer value to be removedIntSet union(IntSet set)
set
- the other set that will be included in the union result
int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |