Class: Pacer::Pipes::TypeFilterPipe

Inherits:
RubyPipe
  • Object
show all
Defined in:
lib/pacer/pipe/type_filter_pipe.rb

Instance Attribute Summary

Attributes inherited from RubyPipe

#starts

Instance Method Summary collapse

Methods inherited from RubyPipe

#setStarts

Constructor Details

#initialize(type) ⇒ TypeFilterPipe



3
4
5
6
# File 'lib/pacer/pipe/type_filter_pipe.rb', line 3

def initialize(type)
  super()
  @type = type
end

Instance Method Details

#processNextStartObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/pacer/pipe/type_filter_pipe.rb', line 8

def processNextStart()
  while @starts.hasNext
    s = @starts.next
    return s if s.is_a? @type
  end
  raise Pacer::NoSuchElementException
rescue NativeException => e
  if e.cause.getClass == Pacer::NoSuchElementException.getClass
    raise e.cause
  else
    raise e
  end
end