Class: Rley::GFG::GrmFlowGraph::Branching
- Inherits:
-
Struct
- Object
- Struct
- Rley::GFG::GrmFlowGraph::Branching
- Defined in:
- lib/rley/gfg/grm_flow_graph.rb
Instance Attribute Summary collapse
-
#in_edge ⇒ Object
Returns the value of attribute in_edge.
-
#to_visit ⇒ Object
Returns the value of attribute to_visit.
-
#vertex ⇒ Object
Returns the value of attribute vertex.
-
#visited ⇒ Object
Returns the value of attribute visited.
Instance Method Summary collapse
- #done? ⇒ Boolean
-
#initialize(aVertex, aCallEdge) ⇒ Branching
constructor
A new instance of Branching.
- #next_edge ⇒ Object
Constructor Details
#initialize(aVertex, aCallEdge) ⇒ Branching
Returns a new instance of Branching.
78 79 80 81 82 83 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 78 def initialize(aVertex, aCallEdge) super(aVertex) self.in_edge = aCallEdge self.to_visit = aVertex.edges.dup self.visited = [] end |
Instance Attribute Details
#in_edge ⇒ Object
Returns the value of attribute in_edge
77 78 79 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 77 def in_edge @in_edge end |
#to_visit ⇒ Object
Returns the value of attribute to_visit
77 78 79 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 77 def to_visit @to_visit end |
#vertex ⇒ Object
Returns the value of attribute vertex
77 78 79 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 77 def vertex @vertex end |
#visited ⇒ Object
Returns the value of attribute visited
77 78 79 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 77 def visited @visited end |
Instance Method Details
#done? ⇒ Boolean
85 86 87 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 85 def done? to_visit.empty? end |
#next_edge ⇒ Object
89 90 91 92 93 94 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 89 def next_edge next_one = to_visit.shift visited << next_one.successor unless next_one.nil? return next_one end |