All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class structure.ComparableAssociation

java.lang.Object
   |
   +----structure.Association
           |
           +----structure.ComparableAssociation

public class ComparableAssociation
extends Association
implements Comparable
An association that can be compared.


Constructor Index

 o ComparableAssociation(Comparable)
Construct an association that can be ordered, from only a key.
 o ComparableAssociation(Comparable, Object)
Construct a key-value association that can be ordered.

Method Index

 o lessThan(Comparable)
Determine the order of two comparable associations, based on key.
 o toString()
Construct a string representation of the ComparableAssociation.

Constructors

 o ComparableAssociation
 public ComparableAssociation(Comparable key)
Construct an association that can be ordered, from only a key. The value is set to null.

Precondition:
key is non-null
Postcondition:
constructs comparable association with null value

Parameters:
key - The (comparable) key.
 o ComparableAssociation
 public ComparableAssociation(Comparable key,
                              Object value)
Construct a key-value association that can be ordered.

Precondition:
key is non-null
Postcondition:
constructs association comparable key and a value

Parameters:
key - The (comparable) key.
value - The (possibly comparable) associated value.

Methods

 o lessThan
 public boolean lessThan(Comparable other)
Determine the order of two comparable associations, based on key.

Precondition:
other is non-null ComparableAssociation
Postcondition:
returns true iff this key is less than other key

Parameters:
other - The other comparable association.
Returns:
True if this association is less than other.
 o toString
 public String toString()
Construct a string representation of the ComparableAssociation.

Postcondition:
returns string representation

Returns:
The string representing the ComparableAssociation.
Overrides:
toString in class Association

All Packages  Class Hierarchy  This Package  Previous  Next  Index