KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > Null


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10 Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11 Suite 350, San Mateo, CA 94403, USA.
12
13 db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

21 package com.db4o;
22
23 import com.db4o.inside.ix.*;
24
25 /**
26  * @exclude
27  */

28 public class Null implements Indexable4{
29     
30     public static final Indexable4 INSTANCE = new Null();
31
32     public Object JavaDoc comparableObject(Transaction trans, Object JavaDoc indexEntry) {
33         return null;
34     }
35
36     public int compareTo(Object JavaDoc a_obj) {
37         if(a_obj == null) {
38             return 0;
39         }
40         return -1;
41     }
42     
43     public Object JavaDoc current(){
44         return null;
45     }
46     
47     public boolean equals(Object JavaDoc obj){
48         return obj == null;
49     }
50     
51     public boolean isEqual(Object JavaDoc obj) {
52         return obj == null;
53     }
54
55     public boolean isGreater(Object JavaDoc obj) {
56         return false;
57     }
58
59     public boolean isSmaller(Object JavaDoc obj) {
60         return false;
61     }
62
63     public int linkLength() {
64         return 0;
65     }
66
67     public YapComparable prepareComparison(Object JavaDoc obj) {
68         // do nothing
69
return this;
70     }
71     
72     public Object JavaDoc readIndexEntry(YapReader a_reader) {
73         return null;
74     }
75
76     public void writeIndexEntry(YapReader a_writer, Object JavaDoc a_object) {
77         // do nothing
78
}
79
80     public void defragIndexEntry(ReaderPair readers) {
81         // do nothing
82
}
83 }
84
85
Popular Tags