KickJava   Java API By Example, From Geeks To Geeks.

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


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

5 package com.jofti.btree;
6
7 /**
8  *
9  * This is a special object in the tree and is used to represent an absolute minimum value for a dimension. <br>
10  * Class cast issues are taken care of in the Value Object class .<p>
11  *
12  * @author Steve Woodcock
13  * @version 1.4<br>
14  */

15 final public class MinComparableValue implements Comparable JavaDoc{
16
17     /* (non-Javadoc)
18      * @see java.lang.Comparable#compareTo(java.lang.Object)
19      */

20     
21     public MinComparableValue(){
22         
23     }
24     
25     public int compareTo(Object JavaDoc o)
26     {
27         if (o == this){
28             return 0;
29         }else{
30             return -1;
31         }
32     }
33     
34     public boolean equals(Object JavaDoc o){
35         if (o instanceof MinComparableValue){
36             return true;
37         }
38         return false;
39     }
40     
41     public int hashCode(){
42         // all has to same value
43
return 0;
44     }
45 }
46
Popular Tags