All Packages Class Hierarchy This Package Previous Next Index
Class rebelsky.util.ComparableString
java.lang.Object
|
+----rebelsky.util.ComparableString
- public class ComparableString
- extends Object
- implements NewComparable
Strings that we can compare using the lessThan operation.
Copyright (c) 1998 Samuel A. Rebelsky. All rights reserved.
- Version:
- 1.1 of March 1998
- Author:
- Samuel A. Rebelsky
Constructor Index
- o
ComparableString(String)
- Build a new comparable string based on another string.
Method Index
- o
equals(Object)
- Compare to another object.
- o
hashCode()
- Compute a hash code for the current object.
- o
lessThan(Comparable)
-
- o
lessThan(Object)
- Compare the present string to another object.
- o
toString()
- Convert to a string.
Constructors
o
ComparableString
public ComparableString(String str)
- Build a new comparable string based on another string.
Methods
o
lessThan
public boolean lessThan(Object other)
- Compare the present string to another object. Returns true if
the current string is smaller and false otherwise.
o
lessThan
public boolean lessThan(Comparable other)
o
toString
public String toString()
- Convert to a string.
- Overrides:
- toString in class Object
o
equals
public boolean equals(Object other)
- Compare to another object.
- Overrides:
- equals in class Object
o
hashCode
public int hashCode()
- Compute a hash code for the current object.
- Overrides:
- hashCode in class Object
All Packages Class Hierarchy This Package Previous Next Index