messif.objects.keys
Class DoubleKeyOperator

java.lang.Object
  extended by messif.objects.keys.KeyOperator<DoubleKey>
      extended by messif.objects.keys.DoubleKeyOperator
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<DoubleKey>

public class DoubleKeyOperator
extends KeyOperator<DoubleKey>
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
DoubleKeyOperator()
           
 
Method Summary
 int compare(DoubleKey o1, DoubleKey o2)
           
 KeyInterval<DoubleKey> createInteral(DoubleKey from, DoubleKey to)
          This method creates an interval given two keys.
 DoubleKey getDifference(DoubleKey first, DoubleKey second)
          Given two keys, return their distance (difference)
 DoubleKey getMaxKey()
          Returns the maximal value of given key type.
 DoubleKey getMiddleKey(DoubleKey first, DoubleKey second)
          Given two keys, return the key in the middle.
 DoubleKey getMinKey()
          Returns the minimal value of given key type.
 DoubleKey getNextKey(DoubleKey key)
          Given a key, return the smallest key which is greater than the key specified.
 DoubleKey getPreviousKey(DoubleKey key)
          Given a key, return the greatest key which is smaller than the key specified.
 KeyInterval<DoubleKey> makeLeftOpen(KeyInterval<DoubleKey> interval)
          This method returns a new instance of KeyInterval which makes this interval opened from the left.
 
Methods inherited from class messif.objects.keys.KeyOperator
intersect, isInBetween, isInBetweenEQ, isInBetweenEQH, isInBetweenEQL, max, min
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

DoubleKeyOperator

public DoubleKeyOperator()
Method Detail

compare

public int compare(DoubleKey o1,
                   DoubleKey o2)
Specified by:
compare in interface java.util.Comparator<DoubleKey>

getMaxKey

public DoubleKey getMaxKey()
Description copied from class: KeyOperator
Returns the maximal value of given key type.

Specified by:
getMaxKey in class KeyOperator<DoubleKey>
Returns:
maximal value of given key type

getMinKey

public DoubleKey getMinKey()
Description copied from class: KeyOperator
Returns the minimal value of given key type.

Specified by:
getMinKey in class KeyOperator<DoubleKey>
Returns:
minimal value of given key type

getNextKey

public DoubleKey getNextKey(DoubleKey key)
Description copied from class: KeyOperator
Given a key, return the smallest key which is greater than the key specified.

Specified by:
getNextKey in class KeyOperator<DoubleKey>
Returns:
return the smallest key which is greater than the key

getPreviousKey

public DoubleKey getPreviousKey(DoubleKey key)
Description copied from class: KeyOperator
Given a key, return the greatest key which is smaller than the key specified.

Specified by:
getPreviousKey in class KeyOperator<DoubleKey>
Returns:
return the greatest key which is smaller than the key

createInteral

public KeyInterval<DoubleKey> createInteral(DoubleKey from,
                                            DoubleKey to)
Description copied from class: KeyOperator
This method creates an interval given two keys.

Specified by:
createInteral in class KeyOperator<DoubleKey>
Parameters:
from - the lower bound
to - the upper bound
Returns:
the created interval

makeLeftOpen

public KeyInterval<DoubleKey> makeLeftOpen(KeyInterval<DoubleKey> interval)
Description copied from class: KeyOperator
This method returns a new instance of KeyInterval which makes this interval opened from the left.

Specified by:
makeLeftOpen in class KeyOperator<DoubleKey>
Parameters:
interval - the closed interval
Returns:
left-opened interval

getDifference

public DoubleKey getDifference(DoubleKey first,
                               DoubleKey second)
Given two keys, return their distance (difference)

Specified by:
getDifference in class KeyOperator<DoubleKey>
Parameters:
first - the first key
second - the second
Returns:
distance of the keys

getMiddleKey

public DoubleKey getMiddleKey(DoubleKey first,
                              DoubleKey second)
Description copied from class: KeyOperator
Given two keys, return the key in the middle.

Specified by:
getMiddleKey in class KeyOperator<DoubleKey>
Parameters:
first - the first key
second - the second
Returns:
key in the middle