KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > dbi > GetMode


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: GetMode.java,v 1.7 2006/10/30 21:14:15 bostic Exp $
7  */

8
9 package com.sleepycat.je.dbi;
10
11 /**
12  * Internal class used to distinguish which variety of getXXX() that
13  * Cursor.retrieveNext should use.
14  */

15 public class GetMode {
16     private String JavaDoc name;
17     private boolean forward;
18
19     private GetMode(String JavaDoc name, boolean forward) {
20         this.name = name;
21         this.forward = forward;
22     }
23
24     public static final GetMode NEXT = new GetMode("NEXT", true);
25     public static final GetMode PREV = new GetMode("PREV", false);
26     public static final GetMode NEXT_DUP = new GetMode("NEXT_DUP", true);
27     public static final GetMode PREV_DUP = new GetMode("PREV_DUP", false);
28     public static final GetMode NEXT_NODUP = new GetMode("NEXT_NODUP", true);
29     public static final GetMode PREV_NODUP = new GetMode("PREV_NODUP", false);
30
31     public final boolean isForward() {
32         return forward;
33     }
34
35     public String JavaDoc toString() {
36         return name;
37     }
38 }
39
Popular Tags