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 DbSequence { 15 private long swigCPtr; 16 protected boolean swigCMemOwn; 17 18 protected DbSequence(long cPtr, boolean cMemoryOwn) { 19 swigCMemOwn = cMemoryOwn; 20 swigCPtr = cPtr; 21 } 22 23 protected static long getCPtr(DbSequence 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 Sequence wrapper; 38 39 public synchronized void close(int flags) throws DatabaseException { 40 try { 41 close0(flags); 42 } finally { 43 swigCPtr = 0; 44 } 45 } 46 47 public synchronized void remove(DbTxn txn, int flags) 48 throws DatabaseException { 49 try { 50 remove0(txn, flags); 51 } finally { 52 swigCPtr = 0; 53 } 54 } 55 56 public DbSequence(Db db, int flags) throws com.sleepycat.db.DatabaseException { 57 this(db_javaJNI.new_DbSequence(Db.getCPtr(db), db, flags), true); 58 } 59 60 /* package */ void close0(int flags) { db_javaJNI.DbSequence_close0(swigCPtr, this, flags); } 61 62 public long get(DbTxn txnid, int delta, int flags) throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get(swigCPtr, this, DbTxn.getCPtr(txnid), txnid, delta, flags); } 63 64 public int get_cachesize() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_cachesize(swigCPtr, this); } 65 66 public Db get_db() throws com.sleepycat.db.DatabaseException { 67 long cPtr = db_javaJNI.DbSequence_get_db(swigCPtr, this); 68 return (cPtr == 0) ? null : new Db(cPtr, false); 69 } 70 71 public int get_flags() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_flags(swigCPtr, this); } 72 73 public void get_key(com.sleepycat.db.DatabaseEntry key) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_get_key(swigCPtr, this, key); } 74 75 public long get_range_min() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_range_min(swigCPtr, this); } 76 77 public long get_range_max() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_range_max(swigCPtr, this); } 78 79 public void initial_value(long val) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_initial_value(swigCPtr, this, val); } 80 81 public void open(DbTxn txnid, com.sleepycat.db.DatabaseEntry key, int flags) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_open(swigCPtr, this, DbTxn.getCPtr(txnid), txnid, key, flags); } 82 83 /* package */ void remove0(DbTxn txnid, int flags) { db_javaJNI.DbSequence_remove0(swigCPtr, this, DbTxn.getCPtr(txnid), txnid, flags); } 84 85 public void set_cachesize(int size) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_set_cachesize(swigCPtr, this, size); } 86 87 public void set_flags(int flags) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_set_flags(swigCPtr, this, flags); } 88 89 public void set_range(long min, long max) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_set_range(swigCPtr, this, min, max); } 90 91 public com.sleepycat.db.SequenceStats stat(int flags) throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_stat(swigCPtr, this, flags); } 92 93} 94