sg.edu.nus.peer.info
Class BoundaryValue

java.lang.Object
  extended by sg.edu.nus.peer.info.BoundaryValue
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class BoundaryValue
extends java.lang.Object
implements java.lang.Comparable, java.io.Serializable

Implement a bound value for a range

See Also:
Serialized Form

Field Summary
static int OFFSET
          Between the upper case and lower case, there are six additional characters, and hence when calculating the average value of two String we simply use this OFFSET value to adjust the median value of two characters.
 
Constructor Summary
BoundaryValue(java.lang.String serializeData)
           
BoundaryValue(java.lang.String stringValue, long longValue)
           
 
Method Summary
static BoundaryValue average(BoundaryValue value1, BoundaryValue value2)
           
 int compareTo(IndexValue compareValue)
           
 int compareTo(java.lang.Object compareObject)
           
 long getLongValue()
           
 java.lang.String getString()
           
 java.lang.String getStringValue()
           
 void setLongValue(long longValue)
           
 void setStringValue(java.lang.String stringValue)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OFFSET

public static final int OFFSET
Between the upper case and lower case, there are six additional characters, and hence when calculating the average value of two String we simply use this OFFSET value to adjust the median value of two characters.

See Also:
Constant Field Values
Constructor Detail

BoundaryValue

public BoundaryValue(java.lang.String stringValue,
                     long longValue)

BoundaryValue

public BoundaryValue(java.lang.String serializeData)
Method Detail

setStringValue

public void setStringValue(java.lang.String stringValue)

getStringValue

public java.lang.String getStringValue()

setLongValue

public void setLongValue(long longValue)

getLongValue

public long getLongValue()

average

public static BoundaryValue average(BoundaryValue value1,
                                    BoundaryValue value2)

compareTo

public int compareTo(IndexValue compareValue)
              throws java.lang.ClassCastException
Throws:
java.lang.ClassCastException

compareTo

public int compareTo(java.lang.Object compareObject)
              throws java.lang.ClassCastException
Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

getString

public java.lang.String getString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object