All Packages Class Hierarchy This Package Previous Next Index
Class rpi.goldsd.container.Str
java.lang.Object
|
+----rpi.goldsd.container.Str
- public class Str
- extends Object
- implements Hashable
The Str class provides a wrapper-class for the String
class that may be used in various associative containers by implementing
the Hashable interface (note that the Hashable interface
is actually an extension of the Comparable interface). The actual
String object is a public instance variable.
- Version:
- 1.0, 3/29/98
- Author:
- David Goldschmidt
- See Also:
- Comparable, Hashable
-
string
- The underlying String object.
-
Str()
- Constructs a Str object with a default value of "".
-
Str(String)
- Initializes the underlying String object.
-
hash()
- Returns the hash value of this Str object, which is simply
the hash value of the underlying String object.
-
hash(int)
- Returns the hash value of this Str object, based on the
given hashtable size.
-
isEqualTo(Comparable)
- Returns true if this Str object is equal to the
given Comparable argument C, which must be of type
Str.
-
isLessThan(Comparable)
- Returns true if this Str object is less than the
given Comparable argument C, which must be of type
Str.
-
toString()
- Displays this Str object in the form of a String object.
string
public String string
- The underlying String object.
Str
public Str(String s)
- Initializes the underlying String object.
- Parameters:
- s - the initial String object.
Str
public Str()
- Constructs a Str object with a default value of "".
isEqualTo
public boolean isEqualTo(Comparable C) throws IllegalArgumentException
- Returns true if this Str object is equal to the
given Comparable argument C, which must be of type
Str.
- Parameters:
- C - the right-hand side of the comparison.
- Returns:
- true if this Str object is equal to the given
Str object C; false otherwise.
- Throws: IllegalArgumentException
- if the Comparable argument
is not of type Str.
isLessThan
public boolean isLessThan(Comparable C) throws IllegalArgumentException
- Returns true if this Str object is less than the
given Comparable argument C, which must be of type
Str.
- Parameters:
- C - the right-hand side of the comparison.
- Returns:
- true if this Str object is less than the
given Str object C; false otherwise.
- Throws: IllegalArgumentException
- if the Comparable argument
is not of type Str.
hash
public int hash()
- Returns the hash value of this Str object, which is simply
the hash value of the underlying String object.
- Returns:
- the hash value of this Str object.
hash
public int hash(int tableSize)
- Returns the hash value of this Str object, based on the
given hashtable size.
- Parameters:
- tableSize - the size of the hashtable making use of
this Str object.
- Returns:
- the hash value of this Str object.
toString
public String toString()
- Displays this Str object in the form of a String object.
This method simply returns a String representation of the
underlying String object.
- Returns:
- a String respresenting this Str object.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index