/** Initialize the key and value of this pair. */ public JMLObjectValuePair( /*@ non_null @*/ Object dv, /*@ non_null @*/ JMLType rv) throws NullPointerException { if (dv == null) { throw new NullPointerException( "Attempt to create a" + " JMLObjectValuePair with null" + " key"); } if (rv == null) { throw new NullPointerException( "Attempt to create a" + " JMLObjectValuePair with null" + " value"); } // @ assume dv != null && rv != null; // @ set owner = null; key = dv; value = (JMLType) rv.clone(); }
/** Return a hash code for this object. */ public int hashCode() { return key.hashCode() + value.hashCode(); }
/*@ public normal_behavior @ ensures \result == (value.equals(rv)); @*/ public boolean valueEquals(JMLType rv) { return value.equals(rv); }