Module org.chocosolver
Interface IntIterableSet
-
- All Known Implementing Classes:
IntIterableBitSet
,IntIterableRangeSet
public interface IntIterableSet extends ISet
An interface to store a set of values, to be used withIntVar.removeValues(IntIterableSet, org.chocosolver.solver.ICause)
andIntVar.removeAllValuesBut(IntIterableSet, org.chocosolver.solver.ICause)
Created by cprudhom on 09/07/15. Project: choco.- Author:
- Charles Prud'homme, Jean-Guillaume Fages
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addAll(int... values)
Adds all of the elements in the array to this set.boolean
addAll(IntIterableSet set)
Adds all of the elements in the specified set to this set.IntIterableSet
duplicate()
Returns a carbon-copy of this setvoid
minus(int x)
subtract the value x to all integers stored in this setint
nextValue(int aValue)
int
nextValueOut(int aValue)
void
plus(int x)
add the value x to all integers stored in this setint
previousValue(int aValue)
int
previousValueOut(int aValue)
boolean
removeAll(IntIterableSet set)
Removes all of this set's elements that are also contained in the specified set.boolean
removeBetween(int f, int t)
Removes all values between f (inclusive) and t (inclusive)boolean
retainAll(IntIterableSet set)
Retains only the elements in this set that are contained in the specified set.-
Methods inherited from interface org.chocosolver.util.objects.setDataStructures.ISet
add, clear, contains, getSetType, isEmpty, iterator, max, min, newIterator, remove, size, toArray
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
addAll
boolean addAll(int... values)
Adds all of the elements in the array to this set.- Parameters:
values
- array containing elements to be added to this set- Returns:
true
if this set changed as a result of the call
-
addAll
boolean addAll(IntIterableSet set)
Adds all of the elements in the specified set to this set.- Parameters:
set
- set containing elements to be added to this set- Returns:
true
if this set changed as a result of the call
-
retainAll
boolean retainAll(IntIterableSet set)
Retains only the elements in this set that are contained in the specified set. In other words, removes from this set all of its elements that are not contained in the specified set.- Parameters:
set
- set containing elements to be retained in this set- Returns:
- true if this set changed as a result of the call
-
removeAll
boolean removeAll(IntIterableSet set)
Removes all of this set's elements that are also contained in the specified set. After this call returns, this set will contain no elements in common with the specified set.- Parameters:
set
- set containing elements to be removed from this set- Returns:
- true if this set changed as a result of the call
-
removeBetween
boolean removeBetween(int f, int t)
Removes all values between f (inclusive) and t (inclusive)- Parameters:
f
- first value to removet
- last value to remove- Returns:
- true if this set changed as a result of the call
-
nextValue
int nextValue(int aValue)
- Parameters:
aValue
- (exclusive)- Returns:
- the value after 'aValue' or
Integer.MAX_VALUE
-
nextValueOut
int nextValueOut(int aValue)
- Parameters:
aValue
- (exclusive)- Returns:
- the value outside thisn after 'aValue'
-
previousValue
int previousValue(int aValue)
- Parameters:
aValue
- (exclusive)- Returns:
- the value before 'aValue' or or
Integer.MIN_VALUE
-
previousValueOut
int previousValueOut(int aValue)
- Parameters:
aValue
- (exclusive)- Returns:
- the value outside this, before'aValue'
-
duplicate
IntIterableSet duplicate()
Returns a carbon-copy of this set- Returns:
- a carbon-copy of this set
-
plus
void plus(int x)
add the value x to all integers stored in this set- Parameters:
x
- value to add
-
minus
void minus(int x)
subtract the value x to all integers stored in this set- Parameters:
x
- value to add
-
-