Parampublic class Param extends Object implements SerializableEncapsulates a name/value pair.
The name of a Param is required to be a string, but its value may be
any Serializable object. Param does not alter value at any time. Thus
Param is an immutable class. |
Fields Summary |
---|
public static long | serialVersionUID | public String | mName | public Serializable | mValue |
Constructors Summary |
---|
public Param(String name, Serializable value)Constructs a new Param with name and value.
//Assert.assert( (name != null), "null name" );
mName = name;
mValue = value;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object other)Defines the logical equality of Param instance with any other
Object. Note that this method does not obey
the general contract of the java.lang.Object.equls() method.
An instance of Param is equal to other Object iff
it is also an instance of Param &&
it has the same name as that of this instance.
It is clear that this method does not take into account the value
of the Param.
boolean isSame = false;
if (other instanceof Param)
{
isSame = this.mName.equals(((Param)other).mName);
}
return isSame;
| public int | hashCode()Generates the hashcode for this param. Since equals() method takes
only name into account, this method also takes into account only
the name.
return (mName.hashCode ());
| public java.lang.String | toString()Generates a string of the form: "name: value".
if ( mValue != null )
{
return( mName + ": " + mValue );
}
return( mName + ": <null>" );
|
|