summaryrefslogtreecommitdiff
path: root/lang/java/src/com/sleepycat/db/internal/DbSequence.java
blob: 38299b855faf65111709a73392251a669ba93ce1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.12
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.sleepycat.db.internal;

import com.sleepycat.db.*;
import java.util.Comparator;

public class DbSequence {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  protected DbSequence(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(DbSequence obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  /* package */ synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        throw new UnsupportedOperationException("C++ destructor does not have public access");
      }
      swigCPtr = 0;
    }
  }

	public Sequence wrapper;

	public synchronized void close(int flags) throws DatabaseException {
		try {
			close0(flags);
		} finally {
			swigCPtr = 0;
		}
	}

	public synchronized void remove(DbTxn txn, int flags)
	    throws DatabaseException {
		try {
			remove0(txn, flags);
		} finally {
			swigCPtr = 0;
		}
	}

  public DbSequence(Db db, int flags) throws com.sleepycat.db.DatabaseException {
    this(db_javaJNI.new_DbSequence(Db.getCPtr(db), db, flags), true);
  }

  /* package */ void close0(int flags) { db_javaJNI.DbSequence_close0(swigCPtr, this, flags); }

  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); }

  public int get_cachesize() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_cachesize(swigCPtr, this); }

  public Db get_db() throws com.sleepycat.db.DatabaseException {
    long cPtr = db_javaJNI.DbSequence_get_db(swigCPtr, this);
    return (cPtr == 0) ? null : new Db(cPtr, false);
  }

  public int get_flags() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_flags(swigCPtr, this); }

  public void get_key(com.sleepycat.db.DatabaseEntry key) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_get_key(swigCPtr, this, key); }

  public long get_range_min() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_range_min(swigCPtr, this); }

  public long get_range_max() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_get_range_max(swigCPtr, this); }

  public void initial_value(long val) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_initial_value(swigCPtr, this, val); }

  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); }

  /* package */ void remove0(DbTxn txnid, int flags) { db_javaJNI.DbSequence_remove0(swigCPtr, this, DbTxn.getCPtr(txnid), txnid, flags); }

  public void set_cachesize(int size) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_set_cachesize(swigCPtr, this, size); }

  public void set_flags(int flags) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_set_flags(swigCPtr, this, flags); }

  public void set_range(long min, long max) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbSequence_set_range(swigCPtr, this, min, max); }

  public com.sleepycat.db.SequenceStats stat(int flags) throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbSequence_stat(swigCPtr, this, flags); }

  public int stat_print(int flags) throws com.sleepycat.db.DatabaseException {
    return db_javaJNI.DbSequence_stat_print(swigCPtr, this, flags);
  }

}