- java.lang.Object
-
- org.chocosolver.util.objects.setDataStructures.SetFactory
-
public class SetFactory extends Object
Factory for creating sets- Since:
- Oct 2012
- Author:
- Jean-Guillaume Fages
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
HARD_CODED
-
Constructor Summary
Constructors Constructor Description SetFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ISet
makeBipartiteSet(int offSet)
Creates a set of integers, based on an offseted bipartite set, Supports integers greater or equal thanoffSet
Optimal complexitystatic ISet
makeBitSet(int offSet)
Creates a set of integers, based on an offseted BitSet, Supports integers greater or equal thanoffSet
static ISet
makeConstantSet(int[] cst)
Creates a fixed set of integers, equal tocst
static ISet
makeConstantSet(int lb, int ub)
Creates a constant set of integers represented with an interval [lb, ub]static ISet
makeLinkedList()
Creates a set based on a linked list appropriate when the set has only a few elementsstatic ISet
makeRangeSet()
Creates a set based on an ordered list of rangesstatic ISet
makeSet(SetType type, int offSet)
Creates an empty set of integers greater or equal thanoffSet
static ISet
makeSmallBipartiteSet()
Creates a set of integers, based on an offseted bipartite set, for small sets (arraylist inside to consume less memory)static ISet
makeStoredSet(SetType type, int offSet, Model model)
Creates a stored set of integers greater or equal thanoffSet
Such a set is restored after a backtrack
-
-
-
Method Detail
-
makeStoredSet
public static ISet makeStoredSet(SetType type, int offSet, Model model)
Creates a stored set of integers greater or equal thanoffSet
Such a set is restored after a backtrack- Parameters:
type
- of set data structureoffSet
- smallest value allowed in the set (possibly < 0)model
- model providing the backtracking environment- Returns:
- a new set which can be restored upon backtrack
-
makeSet
public static ISet makeSet(SetType type, int offSet)
Creates an empty set of integers greater or equal thanoffSet
- Parameters:
type
- implementation typeoffSet
- smallest value allowed in the set (possibly < 0)- Returns:
- a new set
-
makeRangeSet
public static ISet makeRangeSet()
Creates a set based on an ordered list of ranges- Returns:
- a new set
-
makeLinkedList
public static ISet makeLinkedList()
Creates a set based on a linked list appropriate when the set has only a few elements- Returns:
- a new set
-
makeBitSet
public static ISet makeBitSet(int offSet)
Creates a set of integers, based on an offseted BitSet, Supports integers greater or equal thanoffSet
- Parameters:
offSet
- smallest value allowed in the set (possibly < 0)- Returns:
- a new set
-
makeBipartiteSet
public static ISet makeBipartiteSet(int offSet)
Creates a set of integers, based on an offseted bipartite set, Supports integers greater or equal thanoffSet
Optimal complexity- Parameters:
offSet
- smallest value allowed in the set (possibly < 0)- Returns:
- a new bipartite set
-
makeSmallBipartiteSet
public static ISet makeSmallBipartiteSet()
Creates a set of integers, based on an offseted bipartite set, for small sets (arraylist inside to consume less memory)- Returns:
- a new bipartite set
-
makeConstantSet
public static ISet makeConstantSet(int[] cst)
Creates a fixed set of integers, equal tocst
- Parameters:
cst
- set value- Returns:
- a fixed set
-
makeConstantSet
public static ISet makeConstantSet(int lb, int ub)
Creates a constant set of integers represented with an interval [lb, ub]- Returns:
- a new interval (constant)
-
-