Module org.chocosolver
Class Set_LinkedList
- java.lang.Object
-
- org.chocosolver.util.objects.setDataStructures.linkedlist.Set_LinkedList
-
-
Constructor Summary
Constructors Constructor Description Set_LinkedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(int element)
Add element to the setvoid
clear()
Remove all elements from the setboolean
contains(int element)
Test the existence of element in the setSetType
getSetType()
ISetIterator
iterator()
Use the following loop to iterate over this set without autoboxing.int
max()
int
min()
ISetIterator
newIterator()
Creates a new iterator object, for nested loops only.boolean
remove(int element)
Remove the first occurrence of element from the setint
size()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.chocosolver.util.objects.setDataStructures.ISet
isEmpty, toArray
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
size
public int size()
-
contains
public boolean contains(int element)
Description copied from interface:ISet
Test the existence of element in the set
-
add
public boolean add(int element)
Description copied from interface:ISet
Add element to the set
-
remove
public boolean remove(int element)
Description copied from interface:ISet
Remove the first occurrence of element from the set
-
clear
public void clear()
Description copied from interface:ISet
Remove all elements from the set
-
min
public int min()
-
max
public int max()
-
getSetType
public SetType getSetType()
- Specified by:
getSetType
in interfaceISet
- Returns:
- the implementation type of this set
-
iterator
public ISetIterator iterator()
Description copied from interface:ISet
Use the following loop to iterate over this set without autoboxing.// more readable but with autoboxing for(int value:set){ ... } // more verbose but without autoboxing ISetIterator iter = set.primitiveIterator(); while(iter.hasNext()){ int k = iter.next(); ... }
Do not use this iterator to make nested loops overISet
(preferISet.newIterator()
)
-
newIterator
public ISetIterator newIterator()
Description copied from interface:ISet
Creates a new iterator object, for nested loops only.- Specified by:
newIterator
in interfaceISet
- Returns:
- a new iterator for this set
-
-