Class FlatTuple
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple
-
- org.eclipse.viatra.query.runtime.matchers.tuple.Tuple
-
- org.eclipse.viatra.query.runtime.matchers.tuple.BaseFlatTuple
-
- org.eclipse.viatra.query.runtime.matchers.tuple.FlatTuple
-
- All Implemented Interfaces:
ITuple
public final class FlatTuple extends BaseFlatTuple
Default Tuple implementation, with statically unknown arity.
-
-
Field Summary
-
Fields inherited from class org.eclipse.viatra.query.runtime.matchers.tuple.Tuple
cachedHash
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FlatTuple(java.lang.Object... elements)
Creates a FlatTuple instance, fills it with the given array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
get(int index)
java.lang.Object[]
getElements()
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 tuple-
Methods inherited from class org.eclipse.viatra.query.runtime.matchers.tuple.Tuple
equals, hashCode, replaceAll, toImmutable
-
Methods inherited from class org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple
doCalcHash, getDistinctElements, invertIndex, invertIndexWithMupliplicity, raiseIndexingError, toString
-
-
-
-
Constructor Detail
-
FlatTuple
protected FlatTuple(java.lang.Object... elements)
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 Detail
-
get
public java.lang.Object get(int index)
- Returns:
- the element at the specified index
-
getSize
public int getSize()
- Returns:
- number of elements
-
getElements
public java.lang.Object[] 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
protected boolean internalEquals(ITuple other)
Description copied from class:AbstractTuple
Compares the elements stored in this tuple to another tuple- Overrides:
internalEquals
in classAbstractTuple
-
-