Sha256: 89ae9ecb9c908a5d4a2c5d6f6ebc1d07b89434af1d2e5d7de00d64da74f5f30c

Contents?: true

Size: 519 Bytes

Versions: 34

Compression:

Stored size: 519 Bytes

Contents

module Pacer::Graph
  class HashIndex
    attr_reader :name, :type

    def initialize(element_type, name)
      @type = type
      @name = name
      @data = Hash.new do |h, k|
        h[k] = Hash.new { |h, k| h[k] = Set[] }
      end
    end

    def get(key, value)
      Pacer::Pipes::EnumerablePipe.new data[key][value]
    end

    def put(key, value, element)
      data[key][value] << element
    end

    def count(key, value)
      data[key][value].count
    end

    private

    attr_reader :data
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
pacer-2.0.24-java lib/pacer/graph/hash_index.rb
pacer-2.0.22-java lib/pacer/graph/hash_index.rb
pacer-2.0.20-java lib/pacer/graph/hash_index.rb
pacer-2.0.19-java lib/pacer/graph/hash_index.rb
pacer-2.0.18-java lib/pacer/graph/hash_index.rb
pacer-2.0.17-java lib/pacer/graph/hash_index.rb
pacer-2.0.16-java lib/pacer/graph/hash_index.rb
pacer-2.0.15-java lib/pacer/graph/hash_index.rb
pacer-2.0.14-java lib/pacer/graph/hash_index.rb
pacer-2.0.13-java lib/pacer/graph/hash_index.rb
pacer-2.0.12-java lib/pacer/graph/hash_index.rb
pacer-2.0.10-java lib/pacer/graph/hash_index.rb
pacer-2.0.10.pre-java lib/pacer/graph/hash_index.rb
pacer-2.0.8-java lib/pacer/graph/hash_index.rb
pacer-2.0.6-java lib/pacer/graph/hash_index.rb
pacer-2.0.4.pre-java lib/pacer/graph/hash_index.rb
pacer-2.0.0.pre-java lib/pacer/graph/hash_index.rb
pacer-1.6.0-java lib/pacer/graph/hash_index.rb
pacer-1.5.4-java lib/pacer/graph/hash_index.rb
pacer-1.5.3-java lib/pacer/graph/hash_index.rb