JML

org.jmlspecs.models
Class JMLObjectValuePair

java.lang.Object
  extended byorg.jmlspecs.models.JMLObjectValuePair
All Implemented Interfaces:
Cloneable, JMLType, Serializable

public class JMLObjectValuePair
extends Object
implements JMLType

Pairs of Object and JMLType, used in the types JMLObjectToValueRelation and JMLObjectToValueMap.

In a pair the first element is called the "key" and the second the "value". Both the key and the value in a pair must be non-null.

Version:
$Revision: 1.30 $
Author:
Gary T. Leavens, Clyde Ruby
See Also:
JMLObjectToValueRelation, JMLObjectToValueMap

Field Summary
 Object key
          The key of this pair.
 JMLType value
          The value of this pair.
 
Constructor Summary
JMLObjectValuePair(Object dv, JMLType rv)
          Initialize the key and value of this pair.
 
Method Summary
 Object clone()
          Return a clone of this object.
 boolean equals(Object obj)
          Test whether this object's value is equal to the given argument.
 int hashCode()
          Return a hash code for this object.
 boolean keyEquals(Object dv)
          Tell whether this object's key is equal to the given key.
 String toString()
          Return a string representation of this object.
 boolean valueEquals(JMLType rv)
          Tell whether this object's key is equal to the given key.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

key

public final Object key
The key of this pair.


value

public final JMLType value
The value of this pair.

Constructor Detail

JMLObjectValuePair

public JMLObjectValuePair(Object dv,
                          JMLType rv)
                   throws NullPointerException
Initialize the key and value of this pair.

Throws:
NullPointerException
Method Detail

clone

public Object clone()
Description copied from interface: JMLType
Return a clone of this object.

Specified by:
clone in interface JMLType
Overrides:
clone in class Object

keyEquals

public boolean keyEquals(Object dv)
Tell whether this object's key is equal to the given key.

See Also:
equals(java.lang.Object)

valueEquals

public boolean valueEquals(JMLType rv)
Tell whether this object's key is equal to the given key.

See Also:
equals(java.lang.Object)

equals

public boolean equals(Object obj)
Test whether this object's value is equal to the given argument.

Specified by:
equals in interface JMLType
Overrides:
equals in class Object
See Also:
keyEquals(java.lang.Object)

hashCode

public int hashCode()
Return a hash code for this object.

Specified by:
hashCode in interface JMLType
Overrides:
hashCode in class Object

toString

public String toString()
Return a string representation of this object.

Overrides:
toString in class Object

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.