class Jubatus::Clustering::WeightedIndex

Constants

TYPE

Attributes

id[R]
weight[R]

Public Class Methods

from_msgpack(m) click to toggle source
# File lib/jubatus/clustering/types.rb, line 89
def WeightedIndex.from_msgpack(m)
  val = TYPE.from_msgpack(m)
  WeightedIndex.new(*val)
end
new(weight, id) click to toggle source
# File lib/jubatus/clustering/types.rb, line 79
def initialize(weight, id)
  @weight = weight
  @id = id
end

Public Instance Methods

to_msgpack(out = '') click to toggle source
# File lib/jubatus/clustering/types.rb, line 84
def to_msgpack(out = '')
  t = [@weight, @id]
  return TYPE.to_msgpack(t)
end
to_s() click to toggle source
# File lib/jubatus/clustering/types.rb, line 94
def to_s
  gen = Jubatus::Common::MessageStringGenerator.new
  gen.open("weighted_index")
  gen.add("weight", @weight)
  gen.add("id", @id)
  gen.close()
  return gen.to_s
end