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

Variable Index

 o string
The underlying String object.

Constructor Index

 o Str()
Constructs a Str object with a default value of "".
 o Str(String)
Initializes the underlying String object.

Method Index

 o hash()
Returns the hash value of this Str object, which is simply the hash value of the underlying String object.
 o hash(int)
Returns the hash value of this Str object, based on the given hashtable size.
 o isEqualTo(Comparable)
Returns true if this Str object is equal to the given Comparable argument C, which must be of type Str.
 o isLessThan(Comparable)
Returns true if this Str object is less than the given Comparable argument C, which must be of type Str.
 o toString()
Displays this Str object in the form of a String object.

Variables

 o string
 public String string
The underlying String object.

Constructors

 o Str
 public Str(String s)
Initializes the underlying String object.

Parameters:
s - the initial String object.
 o Str
 public Str()
Constructs a Str object with a default value of "".

Methods

 o 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.
 o 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.
 o 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.
 o 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.
 o 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