Class MatchingFrame
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple
-
- org.eclipse.viatra.query.runtime.matchers.tuple.VolatileTuple
-
- org.eclipse.viatra.query.runtime.localsearch.MatchingFrame
-
- All Implemented Interfaces:
IModifiableTuple,ITuple
public class MatchingFrame extends VolatileTuple implements IModifiableTuple
A MatchingFrame is a Volatile Tuple implementation used by the local search engine internally.
-
-
Constructor Summary
Constructors Constructor Description MatchingFrame(int frameSize)MatchingFrame(MatchingFrame other)Creates a copy of another matching frame; the two frames can be updated separately
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectget(int index)java.lang.Object[]getElements()As the tuple is supposed to be immutable, do not modify the returned array.intgetSize()java.lang.ObjectgetValue(int position)Returns the value stored inside the matching frame.voidset(int index, java.lang.Object value)Sets the selected value for a tuplevoidsetValue(int position, java.lang.Object value)Sets the value of the variable at the given position.booleantestAndSetValue(java.lang.Integer position, java.lang.Object value)java.lang.StringtoString()-
Methods inherited from class org.eclipse.viatra.query.runtime.matchers.tuple.VolatileTuple
equals, hashCode, toImmutable
-
Methods inherited from class org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple
doCalcHash, getDistinctElements, internalEquals, invertIndex, invertIndexWithMupliplicity, raiseIndexingError
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.viatra.query.runtime.matchers.tuple.ITuple
getDistinctElements, invertIndex, invertIndexWithMupliplicity, toImmutable
-
-
-
-
Constructor Detail
-
MatchingFrame
public MatchingFrame(int frameSize)
- Since:
- 1.7
-
MatchingFrame
public MatchingFrame(MatchingFrame other)
Creates a copy of another matching frame; the two frames can be updated separately- Parameters:
other-- Since:
- 1.7
-
-
Method Detail
-
getValue
public java.lang.Object getValue(int position)
Returns the value stored inside the matching frame.- Parameters:
position-- Returns:
- the element stored in the selected position in the frame, or null if it is not yet set
- Throws:
java.lang.IndexOutOfBoundsException- if position is negativejava.lang.IllegalArgumentException- if the position is larger then the length of the frame
-
setValue
public void setValue(int position, java.lang.Object value)Sets the value of the variable at the given position. For internal use in LS matching only.- Parameters:
position- the position of the variable within the framevalue- the value to be set for the variable
-
testAndSetValue
public boolean testAndSetValue(java.lang.Integer position, java.lang.Object value)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractTuple
-
get
public java.lang.Object get(int index)
-
getElements
public java.lang.Object[] getElements()
Description copied from class:AbstractTupleAs the tuple is supposed to be immutable, do not modify the returned array.- Specified by:
getElementsin interfaceITuple- Overrides:
getElementsin classAbstractTuple- Returns:
- the array containing all elements of this Tuple
-
set
public void set(int index, java.lang.Object value)Description copied from interface:IModifiableTupleSets the selected value for a tuple- Specified by:
setin interfaceIModifiableTuple
-
-