public final class TupleFactory extends Object
universe: Universe
no f: TupleFactory - this | f.universe = this.universe
Modifier and Type | Method and Description |
---|---|
TupleSet |
allOf(int arity)
Returns a set of all tuples of the given arity, drawn from this.universe.
|
TupleSet |
area(Tuple upperLeft,
Tuple lowerRight)
Returns a tuple set that contains all tuples in the specified area
of the n-dimensional space, where n is the arity of the argument
tuples.
|
TupleSet |
noneOf(int arity)
Returns an initially empty tuple set of the given arity, based on this.universe.
|
TupleSet |
range(Tuple from,
Tuple to)
Returns a tuple set that contains all tuples between
from
and to , inclusive. |
TupleSet |
setOf(Collection<Tuple> tuples)
Returns a tuple set consisting of specified tuples.
|
TupleSet |
setOf(int arity,
IntSet tupleIndices)
Returns a set of the given arity that contains all tuples whose indeces
are contained in the given int set.
|
TupleSet |
setOf(Object... atoms)
Returns a set of tuples of arity 1, each of which wraps one of the given objects.
|
TupleSet |
setOf(Tuple first,
Tuple... rest)
Returns a tuple set consisting of specified tuples.
|
Tuple |
tuple(int arity,
int index)
Returns a tuple with the specified arity whose index in an arity-dimensional
space over this.universe is given by the index parameter.
|
Tuple |
tuple(List<?> atoms)
Returns a tuple that contains the specified sequence of atoms,
drawn from this.universe.
|
Tuple |
tuple(Object... atoms)
Returns a tuple that contains the specified sequence of atoms,
drawn from this.universe.
|
Universe |
universe()
Returns the universe to which this factory belongs.
|
public TupleSet allOf(int arity)
IllegalArgumentException
- arity < 1public TupleSet area(Tuple upperLeft, Tuple lowerRight)
NullPointerException
- upperLeft = null || lowerRight = nullIllegalArgumentException
- upperLeft.arity != lowerRight.arityIllegalArgumentException
- lowerRight.universe != this.universe || upperLeft.universe != this.universeIllegalArgumentException
- some i: [0..upperLeft.arity) |
this.universe.index(upperLeft.atoms[i]) >
this.universe.index(lowerRight.atoms[i])public TupleSet noneOf(int arity)
IllegalArgumentException
- arity < 1public TupleSet range(Tuple from, Tuple to)
from
and to
, inclusive. More formally, the returned set contains
all tuples whose indices are in the range [from.index()..to.index()].NullPointerException
- from = null || to = nullIllegalArgumentException
- from.arity != to.arityIllegalArgumentException
- from.universe != this.universe || to.universe != this.universeIllegalArgumentException
- from.index > to.indexpublic TupleSet setOf(Collection<Tuple> tuples)
NullPointerException
- tuples = nullIllegalArgumentException
- tuples.isEmpty()IllegalArgumentException
- tuples.universe != this.universe || #tuples.arity > 1public TupleSet setOf(int arity, IntSet tupleIndices)
tupleIndices is cloneable
NullPointerException
- tupleIndices = nullIllegalArgumentException
- tupleIndices is uncloneableIllegalArgumentException
- arity < 1IllegalArgumentException
- tupleIndices.min() < 0 || tupleIndices.max() >= this.universe.size()^aritypublic TupleSet setOf(Object... atoms)
NullPointerException
- atoms = nullIllegalArgumentException
- some atoms[int] - this.universe.atoms[int]public TupleSet setOf(Tuple first, Tuple... rest)
NullPointerException
- first = null || rest = nullIllegalArgumentException
- first.universe != this.universeIllegalArgumentException
- some t: rest[int] | t.universe != this.universe || t.arity != first.aritypublic Tuple tuple(int arity, int index)
IllegalArgumentException
- arity < 1 || index < 0 || index >= universe.size^aritypublic Tuple tuple(List<?> atoms)
NullPointerException
- atoms = nullIllegalArgumentException
- atoms.size < 1IllegalArgumentException
- some a: atoms[int] | a !in this.universe.atoms[int]public Tuple tuple(Object... atoms)
NullPointerException
- atoms = nullIllegalArgumentException
- atoms.length < 1IllegalArgumentException
- some a: atoms[int] | a !in this.universe.atoms[int]public Universe universe()
© Emina Torlak 2005-present