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.
| Modifier and Type | Method and Description |
|---|---|
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.
|
void add(int value) throws IllegalArgumentException
value - integer value to be addedIllegalArgumentException - if the value is not supported by this set implementationvoid addAll(IntSet other)
other - the set whose elements will be addedIllegalArgumentException - if any of the values in the other set is not supported by
this set implementationboolean contains(int value)
value - the integer value being checkedtrue if the value is in this setIntSet copy()
boolean isEmpty()
true if there are no elements in the setIntIterator iterator()
int max() throws NoSuchElementException
NoSuchElementException - if the set is emptyint min()
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 resultint size()
Copyright © 2019. All rights reserved.