Class FlatTuple
java.lang.Object
tools.refinery.interpreter.matchers.tuple.AbstractTuple
tools.refinery.interpreter.matchers.tuple.Tuple
tools.refinery.interpreter.matchers.tuple.BaseFlatTuple
tools.refinery.interpreter.matchers.tuple.FlatTuple
- All Implemented Interfaces:
ITuple
Default Tuple implementation, with statically unknown arity.
-
Field Summary
Fields inherited from class tools.refinery.interpreter.matchers.tuple.Tuple
cachedHash
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget
(int index) Object[]
As the tuple is supposed to be immutable, do not modify the returned array.int
getSize()
protected boolean
internalEquals
(ITuple other) Compares the elements stored in this tuple to another tupleMethods inherited from class tools.refinery.interpreter.matchers.tuple.Tuple
equals, hashCode, replaceAll, toImmutable
Methods inherited from class tools.refinery.interpreter.matchers.tuple.AbstractTuple
doCalcHash, getDistinctElements, invertIndex, invertIndexWithMupliplicity, raiseIndexingError, toString
-
Constructor Details
-
FlatTuple
Creates a FlatTuple instance, fills it with the given array.Users should consider calling
Tuples.flatTupleOf(Object...)
instead to save memory on low-arity tuples.- Parameters:
elements
- array of substitution values
-
-
Method Details
-
get
- Returns:
- the element at the specified index
-
getSize
public int getSize()- Returns:
- number of elements
-
getElements
Description copied from class:AbstractTuple
As the tuple is supposed to be immutable, do not modify the returned array.- Specified by:
getElements
in interfaceITuple
- Overrides:
getElements
in classAbstractTuple
- Returns:
- the array containing all elements of this Tuple
-
internalEquals
Description copied from class:AbstractTuple
Compares the elements stored in this tuple to another tuple- Overrides:
internalEquals
in classAbstractTuple
-