Class Set_ReadOnly
- java.lang.Object
-
- org.chocosolver.util.objects.setDataStructures.Set_ReadOnly
-
-
Constructor Summary
Constructors Constructor Description Set_ReadOnly(ISet set)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(int element)Add element to the setvoidclear()Remove all elements from the setbooleancontains(int element)Test the existence of element in the setSetTypegetSetType()ISetIteratoriterator()Use the following loop to iterate over this set without autoboxing.intmax()intmin()ISetIteratornewIterator()Creates a new iterator object, for nested loops only.booleanremove(int element)Remove the first occurrence of element from the setintsize()StringtoString()-
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
-
-
-
-
Constructor Detail
-
Set_ReadOnly
public Set_ReadOnly(ISet set)
-
-
Method Detail
-
newIterator
public ISetIterator newIterator()
Description copied from interface:ISetCreates a new iterator object, for nested loops only.- Specified by:
newIteratorin interfaceISet- Returns:
- a new iterator for this set
-
iterator
public ISetIterator iterator()
Description copied from interface:ISetUse 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())
-
add
public boolean add(int element)
Description copied from interface:ISetAdd element to the set
-
remove
public boolean remove(int element)
Description copied from interface:ISetRemove the first occurrence of element from the set
-
contains
public boolean contains(int element)
Description copied from interface:ISetTest the existence of element in the set
-
size
public int size()
-
clear
public void clear()
Description copied from interface:ISetRemove all elements from the set
-
getSetType
public SetType getSetType()
- Specified by:
getSetTypein interfaceISet- Returns:
- the implementation type of this set
-
min
public int min()
-
-