Sha256: 27f6b37ce81a4e08d93bb89e762ebc89e641041f4d73000ba3f10b06bfc01d11

Contents?: true

Size: 924 Bytes

Versions: 15

Compression:

Stored size: 924 Bytes

Contents

module Pacer::Pipes
  class PropertyComparisonFilterPipe < RubyPipe
    def initialize(left, right, filter)
      super()
      @filter = filter
      @left = left.to_s
      @right = right.to_s
    end

    protected

    def processNextStart
      while true
        obj = @starts.next
        l = obj.getProperty(@left)
        r = obj.getProperty(@right)
        case @filter
        when FilterPipe::Filter::EQUAL
          return obj if l == r
        when FilterPipe::Filter::NOT_EQUAL
          return obj if l != r
        when FilterPipe::Filter::GREATER_THAN
          return obj if l and r and l > r
        when FilterPipe::Filter::LESS_THAN
          return obj if l and r and l < r
        when FilterPipe::Filter::GREATER_THAN_EQUAL
          return obj if l and r and l >= r
        when FilterPipe::Filter::LESS_THAN_EQUAL
          return obj if l and r and l <= r
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
pacer-1.4.2-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.4.1-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.4.0-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.3.5-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.3.4-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.3.3-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.3.2-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.3.1-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.2.0-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.1.1-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.1.0-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.0.3-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.0.2-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.0.1-java lib/pacer/pipe/property_comparison_pipe.rb
pacer-1.0.0-java lib/pacer/pipe/property_comparison_pipe.rb