|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodhelxs.util.BlockStructureNavHelper
public class BlockStructureNavHelper
A navigation helper for walking block structures.
| Field Summary | |
|---|---|
private java.util.Map<Block,java.util.Set<Block>> |
block_predecessors_
Map from blocks to their predecessors (blocks with a pin which is the origin of a relation to a pin of the block). |
private java.util.Map<Block,java.util.Set<Block>> |
block_successors_
Map from blocks to their successors (blocks with a pin which is the target of a relation from a pin of the block). |
private java.util.Map<Block,java.util.Set<Block>> |
filtered_block_predecessors_
Map from blocks to their predecessors, with some relations filtered out. |
private java.util.Map<Block,java.util.Set<Block>> |
filtered_block_successors_
Map from blocks to their successors, with some relations filtered out. |
private java.util.Set<Relation> |
filtered_internal_relations_
Set of internal relations, with some relations filtered out |
private java.util.Set<Relation> |
input_relations_
Set of input relations (relations from pins of the model to pins of the blocks) |
private java.util.Set<Relation> |
internal_relations_
Set of internal relations (relations between pins that do not belong to the model) |
private java.util.Set<Relation> |
output_relations_
Set of output relations (relations from pins of the blocks to pins of the model) |
private java.util.Map<Pin,java.util.Set<Pin>> |
pin_predecessors_
Map from pins to their predecessors. |
private java.util.Map<Pin,java.util.Set<Pin>> |
pin_successors_
Map from pins to their successors. |
private BlockStructure |
structure_
The structure in which we navigate. |
| Constructor Summary | |
|---|---|
BlockStructureNavHelper(BlockStructure s,
RelationFilter filter)
Build a new navigation helper for a block structure, filtering out relations according to a filter. |
|
| Method Summary | ||
|---|---|---|
static
|
addToMapSet(java.util.Map<U,java.util.Set<V>> map,
U key,
V value)
Helper function to add a value to a list associate to a key in a map. |
|
java.util.Collection<Block> |
getBlockPredecessors(ObservableEntity p)
Get the predecessors of block b (blocks with a pin which is a predecessor of a pin of b). |
|
java.util.Collection<Block> |
getBlockSuccessors(Block b)
Get the successors of block b (blocks with a pin which is a successor of a pin of b). |
|
java.util.Collection<Block> |
getFilteredBlockPredecessors(Block p)
Get the predecessors of block b, with some relations filtered out. |
|
java.util.Collection<Block> |
getFilteredBlockSuccessors(ObservableEntity b)
Get the successors of block b, with some relations filtered out. |
|
java.util.Collection<Relation> |
getFilteredInternalRelations()
Return internal relations (not involving the model) ignoring those that are filtered out |
|
java.util.Collection<Relation> |
getInputRelations()
Return input relations (relations from pins of the model to pins of the blocks) |
|
java.util.Collection<Relation> |
getInternalRelations()
Return internal relations (not involving the model) |
|
java.util.Collection<Relation> |
getOutputRelations()
Return output relations (relations from pins of the blocks to pins of the model) |
|
java.util.Collection<Pin> |
getPinPredecessors(Pin p)
Get the predecessors of pin p (pins that are the origin of a relation with target p). |
|
java.util.Collection<Pin> |
getPinSuccessors(Pin p)
Get the successors of pin p (pins that are the target of a relation with origin p). |
|
java.util.List<Block> |
topoSort()
Return a list of the blocks of the structure, topologically sorted. |
|
private void |
visit(Block b,
java.util.Set<Block> visited_blocks,
java.util.List<Block> ordered_blocks)
Visit a block for topological sort. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private BlockStructure structure_
private java.util.Map<Pin,java.util.Set<Pin>> pin_successors_
private java.util.Map<Pin,java.util.Set<Pin>> pin_predecessors_
private java.util.Map<Block,java.util.Set<Block>> block_successors_
private java.util.Map<Block,java.util.Set<Block>> block_predecessors_
private java.util.Map<Block,java.util.Set<Block>> filtered_block_successors_
private java.util.Map<Block,java.util.Set<Block>> filtered_block_predecessors_
private java.util.Set<Relation> internal_relations_
private java.util.Set<Relation> filtered_internal_relations_
private java.util.Set<Relation> input_relations_
private java.util.Set<Relation> output_relations_
| Constructor Detail |
|---|
public BlockStructureNavHelper(BlockStructure s,
RelationFilter filter)
| Method Detail |
|---|
public java.util.Collection<Relation> getInternalRelations()
public java.util.Collection<Relation> getInputRelations()
public java.util.Collection<Relation> getOutputRelations()
public java.util.Collection<Relation> getFilteredInternalRelations()
public static <U,V> void addToMapSet(java.util.Map<U,java.util.Set<V>> map,
U key,
V value)
public java.util.Collection<Pin> getPinSuccessors(Pin p)
p (pins that are the target of a relation with origin p).
public java.util.Collection<Pin> getPinPredecessors(Pin p)
p (pins that are the origin of a relation with target p).
public java.util.Collection<Block> getBlockSuccessors(Block b)
b (blocks with a pin which is a successor of a pin of b).
public java.util.Collection<Block> getBlockPredecessors(ObservableEntity p)
b (blocks with a pin which is a predecessor of a pin of b).
public java.util.Collection<Block> getFilteredBlockSuccessors(ObservableEntity b)
b, with some relations filtered out.
public java.util.Collection<Block> getFilteredBlockPredecessors(Block p)
b, with some relations filtered out.
public java.util.List<Block> topoSort()
private void visit(Block b,
java.util.Set<Block> visited_blocks,
java.util.List<Block> ordered_blocks)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||