KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jofti > btree > MaxComparableValue


1 /*
2  * Created on 03-May-2004
3  *
4  */

5 package com.jofti.btree;
6
7 import java.io.Externalizable JavaDoc;
8 import java.io.IOException JavaDoc;
9 import java.io.ObjectInput JavaDoc;
10 import java.io.ObjectOutput JavaDoc;
11
12 /**
13  *
14  * This is a special object in the tree and is used to represent an absolute maximum value for a dimension. <br>
15  * Class cast issues are taken care of in the Value Object class .<p>
16  *
17  * @author Steve Woodcock
18  * @version 1.5<br>
19  */

20 public class MaxComparableValue implements Comparable JavaDoc, Externalizable JavaDoc{
21
22     /* (non-Javadoc)
23      * @see java.lang.Comparable#compareTo(java.lang.Object)
24      */

25     
26     /**
27      *
28      */

29     private static final long serialVersionUID = -6357574189849245519L;
30
31     public MaxComparableValue(){
32         
33     }
34     
35     public int compareTo(Object JavaDoc o)
36     {
37         if (o instanceof MaxComparableValue){
38             return 0;
39         }else{
40             return 1;
41         }
42     }
43     
44     public boolean equals(Object JavaDoc o){
45         if (o instanceof MaxComparableValue){
46             return true;
47         }
48         return false;
49     }
50     
51     public int hashCode(){
52         // all has to same value
53
return 0;
54     }
55
56     /* (non-Javadoc)
57      * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
58      */

59     public void readExternal(ObjectInput JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc {
60         
61         
62     }
63
64     /* (non-Javadoc)
65      * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
66      */

67     public void writeExternal(ObjectOutput JavaDoc out) throws IOException JavaDoc {
68         
69         
70     }
71 }
72
Popular Tags