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.
98 99 100 101 102 103 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 98 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
97 98 99 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 97 def in_edge @in_edge end |
#to_visit ⇒ Object
Returns the value of attribute to_visit
97 98 99 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 97 def to_visit @to_visit end |
#vertex ⇒ Object
Returns the value of attribute vertex
97 98 99 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 97 def vertex @vertex end |
#visited ⇒ Object
Returns the value of attribute visited
97 98 99 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 97 def visited @visited end |
Instance Method Details
#done? ⇒ Boolean
105 106 107 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 105 def done? to_visit.empty? end |
#next_edge ⇒ Object
109 110 111 112 113 114 |
# File 'lib/rley/gfg/grm_flow_graph.rb', line 109 def next_edge next_one = to_visit.shift visited << next_one.successor unless next_one.nil? return next_one end |