qdbm
Class VillaCursor

java.lang.Object
  extended byqdbm.VillaCursor

public class VillaCursor
extends java.lang.Object

The Java API of cursor functions of Villa This class depends on the native library `jqdbm'.


Method Summary
protected  void finalize()
          Release resources.
 void first()
          Move the multiple cursor to the first record.
 void jump(byte[] key)
          Move the multiple cursor to a position around a record for stepping forward.
 void jump(byte[] key, int jmode)
          Move the multiple cursor to a position around a record.
 void jumpobj(java.lang.Object key, int jmode)
          Move the multiple cursor to a position around a record composed of serializable objects.
 byte[] key()
          Get the key of the record where the multiple cursor is.
 java.lang.Object keyobj()
          Get the key of the record composed of serializable objects, where the multiple cursor is.
 void last()
          Move the multiple cursor to the last record.
 void next()
          Move the multiple cursor to the next record.
 void prev()
          Move the multiple cursor to the next record.
 byte[] val()
          Get the value of the record where the multiple cursor is.
 java.lang.Object valobj()
          Get the value of the record where the multiple cursor is.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

finalize

protected void finalize()
Release resources.


first

public void first()
           throws VillaException
Move the multiple cursor to the first record.

Throws:
VillaException - if an error occurs or there is no record in the database.

jump

public void jump(byte[] key)
          throws VillaException
Move the multiple cursor to a position around a record for stepping forward. The same as `jump(key, Villa.JFORFARD)'.

Throws:
VillaException
See Also:
jump(byte[], int)

jump

public void jump(byte[] key,
                 int jmode)
          throws VillaException
Move the multiple cursor to a position around a record.

Parameters:
key - a byte array of a key.
jmode - detail adjustment: `Villa.JFORWARD', which means that the cursor is set to the first record of the same key and that the cursor is set to the next substitute if completely matching record does not exist, `Villa.JBACKWARD', which means that the cursor is set to the last record of the same key and that the cursor is set to the previous substitute if completely matching record does not exist.
Throws:
VillaException - if an error occurs or there is no record corresponding the condition.

jumpobj

public void jumpobj(java.lang.Object key,
                    int jmode)
             throws VillaException
Move the multiple cursor to a position around a record composed of serializable objects. The same as `jump(qdbm.Util.serialize(key), jmode)'.

Throws:
VillaException
See Also:
jump(byte[], int)
Note:
If serialization is failed, an instance of `VillaException' is thrown.

key

public byte[] key()
           throws VillaException
Get the key of the record where the multiple cursor is.

Throws:
VillaException - if an error occurs or no record corresponds to the cursor.

keyobj

public java.lang.Object keyobj()
                        throws VillaException
Get the key of the record composed of serializable objects, where the multiple cursor is. The same as `qdbm.Util.deserialize(key())'.

Throws:
VillaException
See Also:
key()
Note:
If serialization is failed, an instance of `VillaException' is thrown.

last

public void last()
          throws VillaException
Move the multiple cursor to the last record.

Throws:
VillaException - if an error occurs or there is no record in the database.

next

public void next()
          throws VillaException
Move the multiple cursor to the next record.

Throws:
VillaException - if an error occurs or there is no next record.

prev

public void prev()
          throws VillaException
Move the multiple cursor to the next record.

Throws:
VillaException - if an error occurs or there is no previous record.

val

public byte[] val()
           throws VillaException
Get the value of the record where the multiple cursor is.

Throws:
VillaException - if an error occurs or no record corresponds to the cursor.

valobj

public java.lang.Object valobj()
                        throws VillaException
Get the value of the record where the multiple cursor is. The same as `qdbm.Util.deserialize(val())'.

Throws:
VillaException
See Also:
val()
Note:
If serialization is failed, an instance of `VillaException' is thrown.