choco.cp.solver.constraints.global.geost.dataStructures
Interface Heapable

All Known Implementing Classes:
HeapKey

public interface Heapable

An interface for keys in the heap. Allows the heap to make comparisons to upheap or downheap.

Version:
1.0 2/23/96
Author:
Michael J. Radwin
See Also:
Heap

Method Summary
 boolean equalTo(Object other)
          Determines if this key is equal to the other key.
 boolean greaterThan(Object other)
          Determines if this key is greater than the other key.
 boolean lessThan(Object other)
          Determines if this key is less than the other key.
 

Method Detail

greaterThan

boolean greaterThan(Object other)
Determines if this key is greater than the other key. For example, to compare keys that are subclasses of Integer:
     return (intValue() > ((Integer)other).intValue());
 

Parameters:
other - the key to compare this key to.
Returns:
true if this key is greater than the other key

lessThan

boolean lessThan(Object other)
Determines if this key is less than the other key. For example, to compare keys that are subclasses of Integer:
     return (intValue() < ((Integer)other).intValue());
 

Parameters:
other - the key to compare this key to.
Returns:
true if this key is less than the other key

equalTo

boolean equalTo(Object other)
Determines if this key is equal to the other key. For example, to compare keys that are subclasses of Integer:
     return (intValue() == ((Integer)other).intValue());
 

Parameters:
other - the key to compare this key to.
Returns:
true if this key is equal to the other key


Copyright © 2012. All Rights Reserved.