Class: Pacer::Transform::GatherSection::GatherSectionPipe
- Inherits:
-
Pipes::RubyPipe
- Object
- AbstractPipe
- Pipes::RubyPipe
- Pacer::Transform::GatherSection::GatherSectionPipe
- Defined in:
- lib/pacer/transform/gather_section.rb
Instance Attribute Summary collapse
-
#collecting ⇒ Object
readonly
Returns the value of attribute collecting.
-
#collecting_path ⇒ Object
readonly
Returns the value of attribute collecting_path.
-
#getPathToHere ⇒ Object
readonly
Returns the value of attribute getPathToHere.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#section ⇒ Object
readonly
Returns the value of attribute section.
-
#to_emit ⇒ Object
readonly
Returns the value of attribute to_emit.
-
#wrapper ⇒ Object
readonly
Returns the value of attribute wrapper.
Attributes inherited from Pipes::RubyPipe
Instance Method Summary collapse
- #after_element ⇒ Object
- #emit ⇒ Object
-
#initialize(visitor_pipe, graph, wrapper) ⇒ GatherSectionPipe
constructor
A new instance of GatherSectionPipe.
- #processNextStart ⇒ Object
Methods inherited from Pipes::RubyPipe
#enablePath, #reset, #setStarts
Constructor Details
#initialize(visitor_pipe, graph, wrapper) ⇒ GatherSectionPipe
Returns a new instance of GatherSectionPipe.
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/pacer/transform/gather_section.rb', line 45 def initialize(visitor_pipe, graph, wrapper) super() @collecting = [] @graph = graph @wrapper = wrapper @visitor_pipe = visitor_pipe if visitor_pipe visitor_pipe.visitor = self end end |
Instance Attribute Details
#collecting ⇒ Object (readonly)
Returns the value of attribute collecting.
42 43 44 |
# File 'lib/pacer/transform/gather_section.rb', line 42 def collecting @collecting end |
#collecting_path ⇒ Object (readonly)
Returns the value of attribute collecting_path.
42 43 44 |
# File 'lib/pacer/transform/gather_section.rb', line 42 def collecting_path @collecting_path end |
#getPathToHere ⇒ Object (readonly)
Returns the value of attribute getPathToHere.
43 44 45 |
# File 'lib/pacer/transform/gather_section.rb', line 43 def getPathToHere @getPathToHere end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
42 43 44 |
# File 'lib/pacer/transform/gather_section.rb', line 42 def graph @graph end |
#section ⇒ Object (readonly)
Returns the value of attribute section.
42 43 44 |
# File 'lib/pacer/transform/gather_section.rb', line 42 def section @section end |
#to_emit ⇒ Object (readonly)
Returns the value of attribute to_emit.
42 43 44 |
# File 'lib/pacer/transform/gather_section.rb', line 42 def to_emit @to_emit end |
#wrapper ⇒ Object (readonly)
Returns the value of attribute wrapper.
42 43 44 |
# File 'lib/pacer/transform/gather_section.rb', line 42 def wrapper @wrapper end |
Instance Method Details
#after_element ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/pacer/transform/gather_section.rb', line 89 def after_element unless collecting.empty? @to_emit = collecting @getPathToHere = collecting_path @collecting = [] end end |
#emit ⇒ Object
83 84 85 86 87 |
# File 'lib/pacer/transform/gather_section.rb', line 83 def emit e = to_emit @to_emit = nil e end |
#processNextStart ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/pacer/transform/gather_section.rb', line 56 def processNextStart if pathEnabled while !to_emit e = wrapper.new(graph, starts.next) collecting << e @collecting_path = @visitor_pipe.getCurrentPath end else while !to_emit e = wrapper.new(graph, starts.next) collecting << e end end if !to_emit raise EmptyPipe.instance else emit end rescue EmptyPipe, java.util.NoSuchElementException if collecting @collecting = nil emit else raise EmptyPipe.instance end end |