cc.redberry.core.tensor.iterator
Interface StackPosition<T extends Payload<T>>
-
public interface StackPosition<T extends Payload<T>>- Since:
- 1.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description intcurrentIndex()Returns current index in initial tensor andInteger.MAX_VALUEif initial tensor was rebuilt.intgetDepth()Returns depth in the tree, relatively to the current cursor position.TensorgetInitialTensor()Returns tensor, with which this position was initialized or throws theIllegalStateExceptionif initial tensor is no longer available (was rebuilt).TgetPayload()Returns the payload of current stack position.TensorgetTensor()If tensor was modified somewhere during iteration (by the invocation ofTreeTraverseIterator.set(cc.redberry.core.tensor.Tensor)) this method returns the resulting tensors.booleanisModified()Returnstrueif initial tensor was modified during iteration.booleanisPayloadInitialized()Returns true if lazy payload creation was triggeredbooleanisUnder(Indicator<Tensor> indicator, int searchDepth)StackPosition<T>previous()Returns the position tree node.StackPosition<T>previous(int level)Returns the i-th level position of tree node.
-
-
-
Method Detail
-
getInitialTensor
Tensor getInitialTensor()
Returns tensor, with which this position was initialized or throws theIllegalStateExceptionif initial tensor is no longer available (was rebuilt).- Returns:
- tensor, with which this position was initialized
- Throws:
java.lang.IllegalStateException- if initial tensor is no longer available (was rebuilt)
-
getTensor
Tensor getTensor()
If tensor was modified somewhere during iteration (by the invocation ofTreeTraverseIterator.set(cc.redberry.core.tensor.Tensor)) this method returns the resulting tensors. Otherwise it returns tensor, with which this position was initialized. If tensor was modified, but iteration was not finished yet it throws theIllegalStateExceptionexception.- Returns:
- the resulting tensor, or the initial tensor if it was not modified.
- Throws:
java.lang.IllegalStateException- if tensor was modified, but iteration was not finished.
-
isModified
boolean isModified()
Returnstrueif initial tensor was modified during iteration.- Returns:
trueif initial tensor was modified during iteration
-
previous
StackPosition<T> previous()
Returns the position tree node.- Returns:
- the position tree node
-
previous
StackPosition<T> previous(int level)
Returns the i-th level position of tree node.- Returns:
- the i-th level position of tree node
-
getPayload
T getPayload()
Returns the payload of current stack position.- Returns:
- the payload of current stack position
-
isPayloadInitialized
boolean isPayloadInitialized()
Returns true if lazy payload creation was triggered- Returns:
- true if lazy payload creation was triggered
-
getDepth
int getDepth()
Returns depth in the tree, relatively to the current cursor position.- Returns:
- depth in the tree relatively to the current cursor position
-
currentIndex
int currentIndex()
Returns current index in initial tensor andInteger.MAX_VALUEif initial tensor was rebuilt.- Returns:
- current index in initial tensor and
Integer.MAX_VALUEif initial tensor was rebuilt
-
-
DataMelt 3.0 © DataMelt by jWork.ORG