java.lang.Cloneable
, java.lang.Iterable<java.lang.Object>
public class IntLSet extends LSet implements java.lang.Cloneable
IntLVar
s).USEJOLLYTOKEN
Constructor | Description |
---|---|
IntLSet() |
Constructs a not initialized set with a default name.
|
IntLSet(int p,
int q) |
Constructs a set containing all the integers from
p to q (i.e. the interval [p,q] ) with a default name. |
IntLSet(java.lang.String name) |
Constructs a not initialized set with the given name.
|
IntLSet(java.lang.String name,
int p,
int q) |
Constructs a set containing all the integers from
p to q (i.e. the interval [p,q] ) with the given name. |
IntLSet(java.lang.String name,
java.util.Set<java.lang.Integer> set) |
Constructs an initialized set whose values are the values of
set with the given name |
IntLSet(java.lang.String name,
IntLSet intLSet) |
Constructs a new set equal to
intLSet with a given name. |
IntLSet(java.lang.String name,
MultiInterval multiInterval) |
Constructs an initialized set with all the integers contained in the multi interval
multiInterval and the given name. |
IntLSet(java.util.Set<java.lang.Integer> set) |
Constructs an initialized set whose values are the values of
set with a default name |
IntLSet(IntLSet intLSet) |
Constructs a new set equal to
intLSet with a default name. |
IntLSet(MultiInterval multiInterval) |
Creates an integer logical set containing each element of
multiInterval . |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
accept(jsetl.Visitor visitor) |
Needed for the Visitor design pattern.
|
IntLSet |
clone() |
Clones this set and returns it.
|
Constraint |
domAll(int glb,
int lub) |
Creates glb constraint which requires that all
IntLVars in this set have their domains intersect the interval [glb,lub] . |
static IntLSet |
empty() |
Returns an empty integer logical set.
|
java.util.HashSet<java.lang.Integer> |
getValue() |
Computes an instance of
HashSet containing the known elements in this set. |
IntLSet |
ins(java.lang.Integer integer) |
Computes and returns a new
IntLSet which is equal to this set with the addition of the element integer . |
IntLSet |
ins(java.lang.Integer... integers) |
Computes and returns a new
IntLSet which is equal to this set with the addition of the elements in integers . |
IntLSet |
ins(IntLVar intLVar) |
Computes and returns a new
IntLSet which is equal to this set with the addition of the element intLVar . |
IntLSet |
ins(IntLVar... intLVars) |
Computes and returns a new
IntLSet which is equal to this set with the addition of the elements in intLVars . |
IntLSet |
insAll(java.lang.Integer[] integers) |
Computes and returns a new
IntLSet which is equal to this set with the addition of the elements in integers . |
IntLSet |
insAll(java.util.ArrayList<java.lang.Integer> integers) |
Computes and returns a new
IntLSet which is equal to this set with the addition of the elements in integers . |
IntLSet |
insAll(IntLVar[] intLVars) |
Computes and returns a new
IntLSet which is equal to this set with the addition of the elements in intLVars . |
Constraint |
labelAll() |
Creates a constraint which requires the labeling of all known variables in this set at the moment of the execution of this method.
|
Constraint |
labelAll(LabelingOptions labelingOptions) |
Creates a constraint which requires the labeling of all known variables in this set at the moment of the execution of this method
The constraint resolution will use the given labeling option
labelingOptions . |
static IntLSet |
mkIntSet(int n) |
Constructs and returns a closed logical set containing
n unbound IntLVars . |
IntLSet |
normalizeSet() |
Computes and returns a new set with the same known elements and tail as
this but without duplicates. |
IntLSet |
setName(java.lang.String name) |
Sets the name of this set and returns it.
|
java.lang.String |
toString() |
Returns a string corresponding to the logical set value.
|
forallElems, isClosed, isEmpty, isGround, iterator, testContains, toArray
contains, diff, diff, diff, diff, disj, disj, eq, eq, equals, getSize, getTail, ins, insAll, insAll, inters, inters, inters, inters, less, less, less, less, mkSet, ncontains, ndiff, ndiff, ndiff, ndiff, ndisj, ndisj, neq, neq, ninters, ninters, ninters, ninters, nsubset, nsubset, nunion, nunion, nunion, nunion, occurs, printElems, setValue, size, size, subset, subset, union, union, union, union
public IntLSet()
public IntLSet(@NotNull java.lang.String name)
name
- the name of the set.public IntLSet(@NotNull java.util.Set<java.lang.Integer> set)
set
with a default nameset
- the set containing values for this set. It must not contain null
values.java.lang.NullPointerException
- if set
contains null
values.public IntLSet(@NotNull java.lang.String name, @NotNull java.util.Set<java.lang.Integer> set)
set
with the given namename
- the name of the setset
- the set containing values for this set. It must not contain null
values.java.lang.NullPointerException
- if set
contains null
values.public IntLSet(int p, int q)
p
to q
(i.e. the interval [p,q]
) with a default name.
Constructs the empty set if q
is less than p
.p
- the smallest integer in the interval.q
- the greatest integer in the interval.public IntLSet(@NotNull java.lang.String name, int p, int q)
p
to q
(i.e. the interval [p,q]
) with the given name.
Constructs the empty set if q
is less than p
.name
- the name of the set.p
- the smallest integer in the interval.q
- the greatest integer in the interval.public IntLSet(@NotNull MultiInterval multiInterval)
multiInterval
.multiInterval
- a multi interval.public IntLSet(@NotNull java.lang.String name, @NotNull MultiInterval multiInterval)
multiInterval
and the given name.name
- the name of the set.multiInterval
- the multi interval.public IntLSet(@NotNull IntLSet intLSet)
intLSet
with a default name.
Using this constructor is the same as constructing an uninitialized IntLSet
and then posting and solving the constraint this.eq(intLSet)
.intLSet
- a set.public IntLSet(@NotNull java.lang.String name, @NotNull IntLSet intLSet)
intLSet
with a given name.
Using this constructor is the same as constructing an uninitialized IntLSet
and then posting and solving the constraint this.eq(intLSet)
.name
- the name of the new set.intLSet
- a set.@NotNull public static IntLSet empty()
@NotNull public static IntLSet mkIntSet(int n)
n
unbound IntLVars
.n
- number of unbound IntLVars
. Must not be negative.java.lang.IllegalArgumentException
- if n < 0
.@Nullable public java.lang.Object accept(@NotNull jsetl.Visitor visitor)
@NotNull public java.lang.String toString()
LSet
toString()
to the rest of this collection, if r is not empty.@NotNull public IntLSet setName(@NotNull java.lang.String name)
@Nullable public java.util.HashSet<java.lang.Integer> getValue()
HashSet
containing the known elements in this set.@NotNull public IntLSet ins(@NotNull java.lang.Integer integer)
IntLSet
which is equal to this set with the addition of the element integer
.
DOES NOT modify this set.integer
- the new element@NotNull public IntLSet ins(@NotNull IntLVar intLVar)
IntLSet
which is equal to this set with the addition of the element intLVar
.
DOES NOT modify this set.intLVar
- the new element@NotNull public IntLSet ins(@NotNull java.lang.Integer... integers)
IntLSet
which is equal to this set with the addition of the elements in integers
.
DOES NOT modify this set.integers
- the new elements. None of them can be null
.java.lang.NullPointerException
- if some of the values in integers
are null
.@NotNull public IntLSet ins(@NotNull IntLVar... intLVars)
IntLSet
which is equal to this set with the addition of the elements in intLVars
.
DOES NOT modify this set.intLVars
- the new elements. None of them can be null
.java.lang.NullPointerException
- if some of the values in intLVars
are null
.@NotNull public IntLSet insAll(@NotNull java.lang.Integer[] integers)
IntLSet
which is equal to this set with the addition of the elements in integers
.
DOES NOT modify this set.integers
- the array of elements to add. None of its elements can be null
.java.lang.NullPointerException
- if some of the values in integers
are null
.@NotNull public IntLSet insAll(@NotNull IntLVar[] intLVars)
IntLSet
which is equal to this set with the addition of the elements in intLVars
.
DOES NOT modify this set.intLVars
- the array of elements to add. None of its elements can be null
.sjava.lang.NullPointerException
- if some of the values in intLVars
are null
.@NotNull public IntLSet insAll(@NotNull java.util.ArrayList<java.lang.Integer> integers)
IntLSet
which is equal to this set with the addition of the elements in integers
.
DOES NOT modify this set.integers
- the list of elements to add. None of its elements can be null
.java.lang.NullPointerException
- if some of the values in integers
are null
.@NotNull public IntLSet normalizeSet()
this
but without duplicates.
Does not modify this set.normalizeSet
in class LSet
@NotNull public Constraint domAll(int glb, int lub)
IntLVars
in this set have their domains intersect the interval [glb,lub]
.
The constraint is applied to all known IntLVar
s in this set at the moment of the execution of this method.glb
- greatest lower bound of the interval.lub
- least upper bound of the interval.@NotNull public Constraint labelAll()
@NotNull public Constraint labelAll(@NotNull LabelingOptions labelingOptions)
labelingOptions
.labelingOptions
- labeling options to be used.