1/* ---------------------------------------------------------------------------- 2 * This file was automatically generated by SWIG (http://www.swig.org). 3 * Version 1.3.40 4 * 5 * Do not make changes to this file unless you know what you are doing--modify 6 * the SWIG interface file instead. 7 * ----------------------------------------------------------------------------- */ 8 9package com.sleepycat.db.internal; 10 11import com.sleepycat.db.*; 12import java.util.Comparator; 13 14public class Dbc { 15 private long swigCPtr; 16 protected boolean swigCMemOwn; 17 18 protected Dbc(long cPtr, boolean cMemoryOwn) { 19 swigCMemOwn = cMemoryOwn; 20 swigCPtr = cPtr; 21 } 22 23 protected static long getCPtr(Dbc obj) { 24 return (obj == null) ? 0 : obj.swigCPtr; 25 } 26 27 /* package */ synchronized void delete() { 28 if (swigCPtr != 0) { 29 if (swigCMemOwn) { 30 swigCMemOwn = false; 31 throw new UnsupportedOperationException("C++ destructor does not have public access"); 32 } 33 swigCPtr = 0; 34 } 35 } 36 37 public synchronized void close() throws DatabaseException { 38 try { 39 close0(); 40 } finally { 41 swigCPtr = 0; 42 } 43 } 44 45 /* package */ void close0() { db_javaJNI.Dbc_close0(swigCPtr, this); } 46 47 public int cmp(Dbc odbc, int flags) throws com.sleepycat.db.DatabaseException { 48 return db_javaJNI.Dbc_cmp(swigCPtr, this, Dbc.getCPtr(odbc), odbc, flags); 49 } 50 51 public int count(int flags) throws com.sleepycat.db.DatabaseException { return db_javaJNI.Dbc_count(swigCPtr, this, flags); } 52 53 public int del(int flags) throws com.sleepycat.db.DatabaseException { 54 return db_javaJNI.Dbc_del(swigCPtr, this, flags); 55 } 56 57 public Dbc dup(int flags) throws com.sleepycat.db.DatabaseException { 58 long cPtr = db_javaJNI.Dbc_dup(swigCPtr, this, flags); 59 return (cPtr == 0) ? null : new Dbc(cPtr, false); 60 } 61 62 public int get(com.sleepycat.db.DatabaseEntry key, com.sleepycat.db.DatabaseEntry data, int flags) throws com.sleepycat.db.DatabaseException { 63 return db_javaJNI.Dbc_get(swigCPtr, this, key, data, flags); 64 } 65 66 public int get_priority() throws com.sleepycat.db.DatabaseException { 67 return db_javaJNI.Dbc_get_priority(swigCPtr, this); 68 } 69 70 public int pget(com.sleepycat.db.DatabaseEntry key, com.sleepycat.db.DatabaseEntry pkey, com.sleepycat.db.DatabaseEntry data, int flags) throws com.sleepycat.db.DatabaseException { 71 return db_javaJNI.Dbc_pget(swigCPtr, this, key, pkey, data, flags); 72 } 73 74 public int put(com.sleepycat.db.DatabaseEntry key, com.sleepycat.db.DatabaseEntry db_put_data, int flags) throws com.sleepycat.db.DatabaseException { 75 return db_javaJNI.Dbc_put(swigCPtr, this, key, db_put_data, flags); 76 } 77 78 public void set_priority(int priority) throws com.sleepycat.db.DatabaseException { db_javaJNI.Dbc_set_priority(swigCPtr, this, priority); } 79 80} 81