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.
ComparableAssociation(Comparable)
- Construct an association that can be ordered, from only a key.
ComparableAssociation(Comparable, Object)
- Construct a key-value association that can be ordered.
compareTo(Object)
- Determine the order of two comparable associations, based on key.
toString()
- Construct a string representation of the ComparableAssociation.
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.
ComparableAssociation
public ComparableAssociation(Comparable key,
Object value)
- Construct a key-value association that can be ordered.
- Precondition:
- key is non-null
- Postcondition:
- constructs association between a comparable key and a value
- Parameters:
- key - The (comparable) key.
- value - The (possibly comparable) associated value.
compareTo
public int compareTo(Object other)
- Determine the order of two comparable associations, based on key.
- Precondition:
- other is non-null ComparableAssociation
- Postcondition:
- returns integer representing relation between values.
- Parameters:
- other - The other comparable association.
- Returns:
- Value less-than equal to or greater than zero based on comparison
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