Class: Java::Kyotocabinet::Cursor

Inherits:
Object
  • Object
show all
Includes:
KyotoCabinet::Adaptation
Defined in:
lib/kyotocabinet.rb

Constant Summary

Constants included from KyotoCabinet::Adaptation

KyotoCabinet::Adaptation::BYTE_ARRAY

Instance Method Summary collapse

Methods included from KyotoCabinet::Adaptation

#conv_string_array, included, #ret_bytes, #to_string_array

Instance Method Details

#_acceptObject



173
# File 'lib/kyotocabinet.rb', line 173

alias_method :_accept, :accept

#_getObject



188
# File 'lib/kyotocabinet.rb', line 188

alias_method :_get, :get

#_get_keyObject



199
# File 'lib/kyotocabinet.rb', line 199

alias_method :_get_key, :get_key

#_get_valueObject



204
# File 'lib/kyotocabinet.rb', line 204

alias_method :_get_value, :get_value

#_jumpObject



210
# File 'lib/kyotocabinet.rb', line 210

alias_method :_jump, :jump

#_jump_backObject



219
# File 'lib/kyotocabinet.rb', line 219

alias_method :_jump_back, :jump_back

#_seizeObject



228
# File 'lib/kyotocabinet.rb', line 228

alias_method :_seize, :seize

#_set_valueObject



234
# File 'lib/kyotocabinet.rb', line 234

alias_method :_set_value, :set_value

#accept(visitor = nil, writable = true, step = false) ⇒ Object



174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/kyotocabinet.rb', line 174

def accept(visitor=nil, writable=true, step=false)
  vp = if visitor
         VisitorProxy.new(visitor, !writable)
       else
         if writable
           BlockVisitor.wrap(blk)
         else
           BlockVisitor.wrap_nop(blk)
         end
       end
  _accept(vp, writable, step)
end

#get(step = false) ⇒ Object



189
190
191
192
193
194
195
196
197
# File 'lib/kyotocabinet.rb', line 189

def get(step=false)
  r = self._get(step)
  if r
    return [String.from_java_bytes(r[0]),
            String.from_java_bytes(r[1])]
  else
    return nil
  end
end

#get_key(step = false) ⇒ Object



200
201
202
# File 'lib/kyotocabinet.rb', line 200

def get_key(step=false)
  ret_bytes(_get_key(step))
end

#get_value(step = false) ⇒ Object



205
206
207
# File 'lib/kyotocabinet.rb', line 205

def get_value(step=false)
  ret_bytes(_get_value(step))
end

#jump(key = nil) ⇒ Object



211
212
213
214
215
216
217
# File 'lib/kyotocabinet.rb', line 211

def jump(key=nil)
  if key
    _jump(key.to_java_bytes)
  else
    _jump()
  end
end

#jump_back(key = nil) ⇒ Object



220
221
222
223
224
225
226
# File 'lib/kyotocabinet.rb', line 220

def jump_back(key=nil)
  if key
    _jump_back(key.to_java_bytes)
  else
    _jump_back()
  end
end

#seizeObject



229
230
231
# File 'lib/kyotocabinet.rb', line 229

def seize()
  to_string_array(_seize())
end

#set_value(value, step = false) ⇒ Object



235
236
237
238
# File 'lib/kyotocabinet.rb', line 235

def set_value(value, step=false)
  _set_value(value ? value.to_java_bytes : nil,
             step)
end