hashCode method in Datatype

Elliotte Harold <[email protected]> Tue, 02 Nov 2004 13:59:30 -0500
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
The JavaDoc for the valueHashCode(Object) method in 
org.relaxng.datatype.Datatype states:

public int valueHashCode(java.lang.Object value)

Computes the hash code for a value object, which is consistent with the 
sameValue method.

What should this method do if the value object passed as an argument is 
not an instance of the datatype returned by createValue()? Throw an 
exception? Return that object's hashCode? Something else? The spec does 
not clarify.

For sameValue() the spec states. "The behavior is undefined if objects 
not created by this type are passed. It is the caller's responsibility 
to ensure that value objects belong to this type." However there's no 
such wording for valueHashCode.

-- 
Elliotte Rusty Harold  [email protected]
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim