messif.objects.keys
Class DoubleKeyInterval

java.lang.Object
  extended by messif.objects.keys.KeyInterval<DoubleKey>
      extended by messif.objects.keys.DoubleKeyInterval
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<KeyInterval<DoubleKey>>, BinarySerializable

public class DoubleKeyInterval
extends KeyInterval<DoubleKey>
implements java.io.Serializable, BinarySerializable

See Also:
Serialized Form

Field Summary
protected  DoubleKey from
          Lower bound (inclusive).
protected  DoubleKey to
          Upeer bound (inclusive).
 
Constructor Summary
protected DoubleKeyInterval(BinaryInput input, BinarySerializator serializator)
          Creates a new instance of DoubleKeyInterval loaded from binary input.
  DoubleKeyInterval(DoubleKey from, DoubleKey to)
          Constructor for this interval.
 
Method Summary
 int binarySerialize(BinaryOutput output, BinarySerializator serializator)
          Binary-serialize this object into the output.
 int compareTo(KeyInterval<DoubleKey> o)
           
 int getBinarySize(BinarySerializator serializator)
          Returns the exact size of the binary-serialized version of this object in bytes.
 DoubleKey getFrom()
          Returns the lower bound.
 DoubleKey getTo()
          Returns the upper bound.
 
Methods inherited from class messif.objects.keys.KeyInterval
cutIntersectingIntervals, cutIntersectingIntervalsInner, equals, hashCode, intersect, isCovered, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

from

protected final DoubleKey from
Lower bound (inclusive).


to

protected final DoubleKey to
Upeer bound (inclusive).

Constructor Detail

DoubleKeyInterval

public DoubleKeyInterval(DoubleKey from,
                         DoubleKey to)
Constructor for this interval.

Parameters:
from - lower bound (inclusive)
to - upper bound (inclusive)

DoubleKeyInterval

protected DoubleKeyInterval(BinaryInput input,
                            BinarySerializator serializator)
                     throws java.io.IOException
Creates a new instance of DoubleKeyInterval loaded from binary input.

Parameters:
input - the input to read the DoubleKeyInterval from
serializator - the serializator used to write objects
Throws:
java.io.IOException - if there was an I/O error reading from the input
Method Detail

getFrom

public DoubleKey getFrom()
Returns the lower bound.

Specified by:
getFrom in class KeyInterval<DoubleKey>
Returns:
the lower bound.

getTo

public DoubleKey getTo()
Returns the upper bound.

Specified by:
getTo in class KeyInterval<DoubleKey>
Returns:
the upper bound.

compareTo

public int compareTo(KeyInterval<DoubleKey> o)
Specified by:
compareTo in interface java.lang.Comparable<KeyInterval<DoubleKey>>

binarySerialize

public int binarySerialize(BinaryOutput output,
                           BinarySerializator serializator)
                    throws java.io.IOException
Binary-serialize this object into the output.

Specified by:
binarySerialize in interface BinarySerializable
Parameters:
output - the output that this object is binary-serialized into
serializator - the serializator used to write objects
Returns:
the number of bytes actually written
Throws:
java.io.IOException - if there was an I/O error during serialization

getBinarySize

public int getBinarySize(BinarySerializator serializator)
Returns the exact size of the binary-serialized version of this object in bytes.

Specified by:
getBinarySize in interface BinarySerializable
Parameters:
serializator - the serializator used to write objects
Returns:
size of the binary-serialized version of this object