public class SetFactory extends Object
Modifier and Type | Field and Description |
---|---|
static boolean |
HARD_CODED |
static boolean |
RECYCLE |
Constructor and Description |
---|
SetFactory() |
Modifier and Type | Method and Description |
---|---|
static ISet |
makeArray(int n)
Creates a set based on a boolean array
|
static ISet |
makeBitSet(int n)
Creates a stored set based on a BitSet
|
static ISet |
makeFullSet(int n)
Creates a set that will ALWAYS contain all values from 0 to n-1
|
static ISet |
makeLinkedList(boolean doubleLink)
Creates a set based on a linked list
appropriate when the set has only a few elements
|
static ISet |
makeSet(SetType type,
int maximumSize)
Make a set of integers in the range [0,maximumSize-1]
|
static ISet |
makeStoredSet(SetType type,
int maximumSize,
Solver solver)
Make a stored set of integers in the range [0,maximumSize-1]
Such a set is restored after a backtrack
|
static ISet |
makeSwap(int n,
boolean hash)
Creates a set based on swaps
Optimal complexity
|
public static ISet makeStoredSet(SetType type, int maximumSize, Solver solver)
type
- of set data structuremaximumSize
- of the set (maximum value -1)solver
- solver providing the backtracking environmentpublic static ISet makeSet(SetType type, int maximumSize)
type
- of set data structuremaximumSize
- of the set (maximum value -1)public static ISet makeLinkedList(boolean doubleLink)
doubleLink
- enable double linkspublic static ISet makeBitSet(int n)
n
- maximal size of the setpublic static ISet makeArray(int n)
n
- maximal size of the setpublic static ISet makeFullSet(int n)
n
- size of the setpublic static ISet makeSwap(int n, boolean hash)
n
- maximal size of the sethash
- lighter in memory by slower (false is recommended)Copyright © 2015. All rights reserved.