Class: Jubatus::Burst::Window

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/jubatus/burst/types.rb

Constant Summary collapse

TYPE =
TTuple.new(TFloat.new, TList.new(TUserDef.new(Batch)))

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

check_type, check_types

Constructor Details

#initialize(start_pos, batches) ⇒ Window

Returns a new instance of Window.



83
84
85
86
# File 'lib/jubatus/burst/types.rb', line 83

def initialize(start_pos, batches)
  @start_pos = start_pos
  @batches = batches
end

Instance Attribute Details

#batchesObject (readonly)

Returns the value of attribute batches.



107
108
109
# File 'lib/jubatus/burst/types.rb', line 107

def batches
  @batches
end

#start_posObject (readonly)

Returns the value of attribute start_pos.



107
108
109
# File 'lib/jubatus/burst/types.rb', line 107

def start_pos
  @start_pos
end

Class Method Details

.from_msgpack(m) ⇒ Object



93
94
95
96
# File 'lib/jubatus/burst/types.rb', line 93

def Window.from_msgpack(m)
  val = TYPE.from_msgpack(m)
  Window.new(*val)
end

Instance Method Details

#to_msgpack(out = '') ⇒ Object



88
89
90
91
# File 'lib/jubatus/burst/types.rb', line 88

def to_msgpack(out = '')
  t = [@start_pos, @batches]
  return TYPE.to_msgpack(t)
end

#to_sObject



98
99
100
101
102
103
104
105
# File 'lib/jubatus/burst/types.rb', line 98

def to_s
  gen = Jubatus::Common::MessageStringGenerator.new
  gen.open("window")
  gen.add("start_pos", @start_pos)
  gen.add("batches", @batches)
  gen.close()
  return gen.to_s
end