summaryrefslogtreecommitdiff
path: root/lang/java/src/com/sleepycat/db/internal/Dbc.java
blob: 5dd47fe2650777e8b245279b37242e189aa127bb (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
/* ----------------------------------------------------------------------------
 * 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 Dbc {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

  protected static long getCPtr(Dbc 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 synchronized void close() throws DatabaseException {
		try {
			close0();
		} finally {
			swigCPtr = 0;
		}
	}

  /* package */ void close0() { db_javaJNI.Dbc_close0(swigCPtr, this); }

  public int cmp(Dbc odbc, int flags) throws com.sleepycat.db.DatabaseException {
    return db_javaJNI.Dbc_cmp(swigCPtr, this, Dbc.getCPtr(odbc), odbc, flags);
  }

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

  public DbStream db_stream(int flags) throws com.sleepycat.db.DatabaseException {
    long cPtr = db_javaJNI.Dbc_db_stream(swigCPtr, this, flags);
    return (cPtr == 0) ? null : new DbStream(cPtr, false);
  }

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

  public Dbc dup(int flags) throws com.sleepycat.db.DatabaseException {
    long cPtr = db_javaJNI.Dbc_dup(swigCPtr, this, flags);
    return (cPtr == 0) ? null : new Dbc(cPtr, false);
  }

  public int get(com.sleepycat.db.DatabaseEntry key, com.sleepycat.db.DatabaseEntry data, int flags) throws com.sleepycat.db.DatabaseException {
    return db_javaJNI.Dbc_get(swigCPtr, this, key, data, flags);
  }

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

  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 {
    return db_javaJNI.Dbc_pget(swigCPtr, this, key, pkey, data, flags);
  }

  public int put(com.sleepycat.db.DatabaseEntry key, com.sleepycat.db.DatabaseEntry db_put_data, int flags) throws com.sleepycat.db.DatabaseException {
    return db_javaJNI.Dbc_put(swigCPtr, this, key, db_put_data, flags);
  }

  public void set_priority(int priority) throws com.sleepycat.db.DatabaseException { db_javaJNI.Dbc_set_priority(swigCPtr, this, priority); }

}