Interface mjr.heap.Heapable
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface mjr.heap.Heapable

public interface Heapable
extends Object
An interface for keys in the heap. Allows the heap to make comparisons to upheap or downheap.
See Also:
Heap

Method Index

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

Methods

 o greaterThan
  public abstract 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
 o lessThan
  public abstract 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
 o equalTo
  public abstract 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index