utilities
Interface MyComparable
- public abstract interface MyComparable
- extends java.lang.Comparable
Interface to be implemented by all classes
that permit comparison between their objects.
compareTo
public int compareTo(java.lang.Object x)
- Specified by:
- compareTo in interface java.lang.Comparable
- Returns:
- -1 if this < x,
0 if this == x,
1 if this > x
lessThan
public boolean lessThan(java.lang.Object x)
- Returns:
- true iff this < x
lessThanOrEqual
public boolean lessThanOrEqual(java.lang.Object x)
- Returns:
- true iff this <= x
greaterThan
public boolean greaterThan(java.lang.Object x)
- Returns:
- true iff this > x
greaterThanOrEqual
public boolean greaterThanOrEqual(java.lang.Object x)
- Returns:
- true iff this >= x
equals
public boolean equals(java.lang.Object x)
- Returns:
- true iff this == x
- Overrides:
- equals in class java.lang.Object