[relaxng-user] hashCode method in Datatype

Elliotte Harold elharo at metalab.unc.edu
Tue Nov 2 13:59:30 ICT 2004


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  elharo at metalab.unc.edu
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



More information about the relaxng-user mailing list