public class TreeStructure
extends java.lang.Object
Constructor and Description |
---|
TreeStructure(io.molr.commons.domain.MissionRepresentation representation,
java.util.Set<io.molr.commons.domain.Block> parallelBlocks) |
Modifier and Type | Method and Description |
---|---|
java.util.Set<io.molr.commons.domain.Block> |
allBlocks() |
java.util.List<io.molr.commons.domain.Block> |
childrenOf(io.molr.commons.domain.Block block) |
boolean |
contains(io.molr.commons.domain.Block block) |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isDescendantOf(io.molr.commons.domain.Block target,
io.molr.commons.domain.Block source)
Determines whether or not the
target is a descendant of the source block in this structure. |
boolean |
isLeaf(io.molr.commons.domain.Block block) |
boolean |
isParallel(io.molr.commons.domain.Block block) |
io.molr.commons.domain.MissionRepresentation |
missionRepresentation() |
java.util.Optional<io.molr.commons.domain.Block> |
nextBlock(io.molr.commons.domain.Block actualBlock)
Optionally returns the next block in the tree structure of the specified parameter.
|
java.util.Optional<io.molr.commons.domain.Block> |
parentOf(io.molr.commons.domain.Block block) |
io.molr.commons.domain.Block |
rootBlock() |
TreeStructure |
substructure(io.molr.commons.domain.Block block)
Returns a new
TreeStructure with the specified Block as root. |
public TreeStructure(io.molr.commons.domain.MissionRepresentation representation, java.util.Set<io.molr.commons.domain.Block> parallelBlocks)
public TreeStructure substructure(io.molr.commons.domain.Block block)
TreeStructure
with the specified Block
as root. It will not return a view of this
structure but a completely new one.
NOTE: The current implementation is not optimized for performance...
public java.util.Optional<io.molr.commons.domain.Block> nextBlock(io.molr.commons.domain.Block actualBlock)
Optional
indicates that there is no next block and the tree navigation can be
considered finished
TODO ?? think if it makes sense to have a VisitorInstance that knows how to navigate from a block onwards..
public java.util.List<io.molr.commons.domain.Block> childrenOf(io.molr.commons.domain.Block block)
public boolean isParallel(io.molr.commons.domain.Block block)
public boolean isLeaf(io.molr.commons.domain.Block block)
public io.molr.commons.domain.Block rootBlock()
public java.util.Set<io.molr.commons.domain.Block> allBlocks()
public boolean contains(io.molr.commons.domain.Block block)
public io.molr.commons.domain.MissionRepresentation missionRepresentation()
public boolean isDescendantOf(io.molr.commons.domain.Block target, io.molr.commons.domain.Block source)
target
is a descendant of the source
block in this structure.
NOTE: The current implementation is not optimized for performance...
public java.util.Optional<io.molr.commons.domain.Block> parentOf(io.molr.commons.domain.Block block)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object