Class: Jubatus::Clustering::IndexedPoint
- Inherits:
-
Object
- Object
- Jubatus::Clustering::IndexedPoint
- Includes:
- Jubatus::Common
- Defined in:
- lib/jubatus/clustering/types.rb
Constant Summary collapse
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#point ⇒ Object
readonly
Returns the value of attribute point.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, point) ⇒ IndexedPoint
constructor
A new instance of IndexedPoint.
- #to_msgpack(out = '') ⇒ Object
- #to_s ⇒ Object
Methods included from Jubatus::Common
Constructor Details
#initialize(id, point) ⇒ IndexedPoint
Returns a new instance of IndexedPoint.
47 48 49 50 |
# File 'lib/jubatus/clustering/types.rb', line 47 def initialize(id, point) @id = id @point = point end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
71 72 73 |
# File 'lib/jubatus/clustering/types.rb', line 71 def id @id end |
#point ⇒ Object (readonly)
Returns the value of attribute point.
71 72 73 |
# File 'lib/jubatus/clustering/types.rb', line 71 def point @point end |
Class Method Details
.from_msgpack(m) ⇒ Object
57 58 59 60 |
# File 'lib/jubatus/clustering/types.rb', line 57 def IndexedPoint.from_msgpack(m) val = TYPE.from_msgpack(m) IndexedPoint.new(*val) end |
Instance Method Details
#to_msgpack(out = '') ⇒ Object
52 53 54 55 |
# File 'lib/jubatus/clustering/types.rb', line 52 def to_msgpack(out = '') t = [@id, @point] return TYPE.to_msgpack(t) end |
#to_s ⇒ Object
62 63 64 65 66 67 68 69 |
# File 'lib/jubatus/clustering/types.rb', line 62 def to_s gen = Jubatus::Common::MessageStringGenerator.new gen.open("indexed_point") gen.add("id", @id) gen.add("point", @point) gen.close() return gen.to_s end |