Class: Jubatus::Graph::ShortestPathQuery

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

Constant Summary collapse

TYPE =
TTuple.new(TString.new, TString.new, TInt.new(false, 4), TUserDef.new(
PresetQuery))

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

check_type, check_types

Constructor Details

#initialize(source, target, max_hop, query) ⇒ ShortestPathQuery

Returns a new instance of ShortestPathQuery.



151
152
153
154
155
156
# File 'lib/jubatus/graph/types.rb', line 151

def initialize(source, target, max_hop, query)
  @source = source
  @target = target
  @max_hop = max_hop
  @query = query
end

Instance Attribute Details

#max_hopObject (readonly)

Returns the value of attribute max_hop.



179
180
181
# File 'lib/jubatus/graph/types.rb', line 179

def max_hop
  @max_hop
end

#queryObject (readonly)

Returns the value of attribute query.



179
180
181
# File 'lib/jubatus/graph/types.rb', line 179

def query
  @query
end

#sourceObject (readonly)

Returns the value of attribute source.



179
180
181
# File 'lib/jubatus/graph/types.rb', line 179

def source
  @source
end

#targetObject (readonly)

Returns the value of attribute target.



179
180
181
# File 'lib/jubatus/graph/types.rb', line 179

def target
  @target
end

Class Method Details

.from_msgpack(m) ⇒ Object



163
164
165
166
# File 'lib/jubatus/graph/types.rb', line 163

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

Instance Method Details

#to_msgpack(out = '') ⇒ Object



158
159
160
161
# File 'lib/jubatus/graph/types.rb', line 158

def to_msgpack(out = '')
  t = [@source, @target, @max_hop, @query]
  return TYPE.to_msgpack(t)
end

#to_sObject



168
169
170
171
172
173
174
175
176
177
# File 'lib/jubatus/graph/types.rb', line 168

def to_s
  gen = Jubatus::Common::MessageStringGenerator.new
  gen.open("shortest_path_query")
  gen.add("source", @source)
  gen.add("target", @target)
  gen.add("max_hop", @max_hop)
  gen.add("query", @query)
  gen.close()
  return gen.to_s
end