Sha256: 7f9cf0ca8f83196f806794c7464630e3425b024d778edd0c04eaef593261ba48

Contents?: true

Size: 868 Bytes

Versions: 11

Compression:

Stored size: 868 Bytes

Contents

module Pacer::Pipes
  class IdCollectionFilterPipe < RubyPipe
    import com.tinkerpop.blueprints.Contains
    attr_reader :contains_in

    def initialize(ids, comparison)
      super()
      @ids = Set[*ids]
      if comparison == Contains::IN
        @contains_in = true
      elsif
        comparison == Contains::NOT_IN
        @contains_in = false
      else
        fail InternalError, "Unknown comparison type for ID collection filter"
      end
    end

    def processNextStart
      if contains_in
        while true
          element = @starts.next
          if element and @ids.include? element.getId
            return element
          end
        end
      else
        while true
          element = @starts.next
          if element and not @ids.include? element.getId
            return element
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pacer-2.0.10-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-2.0.10.pre-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-2.0.8-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-2.0.6-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-2.0.4.pre-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-2.0.0.pre-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-1.6.0-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-1.5.4-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-1.5.3-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-1.5.2-java lib/pacer/pipe/id_collection_filter_pipe.rb
pacer-1.5.1-java lib/pacer/pipe/id_collection_filter_pipe.rb