01: /*
02: * Created on 03-May-2004
03: *
04: */
05: package com.jofti.btree;
06:
07: import java.io.Externalizable;
08: import java.io.IOException;
09: import java.io.ObjectInput;
10: import java.io.ObjectOutput;
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, Externalizable {
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 o) {
36: if (o instanceof MaxComparableValue) {
37: return 0;
38: } else {
39: return 1;
40: }
41: }
42:
43: public boolean equals(Object o) {
44: if (o instanceof MaxComparableValue) {
45: return true;
46: }
47: return false;
48: }
49:
50: public int hashCode() {
51: // all has to same value
52: return 0;
53: }
54:
55: /* (non-Javadoc)
56: * @see java.io.Externalizable#readExternal(java.io.ObjectInput)
57: */
58: public void readExternal(ObjectInput in) throws IOException,
59: ClassNotFoundException {
60:
61: }
62:
63: /* (non-Javadoc)
64: * @see java.io.Externalizable#writeExternal(java.io.ObjectOutput)
65: */
66: public void writeExternal(ObjectOutput out) throws IOException {
67:
68: }
69: }
|