FW: [jdom-interest] Text class (Modified)

bob mcwhirter bob at werken.com
Thu May 31 21:33:27 PDT 2001


> >> It's probably also worthwhile to implement Comparable. (Seems 
> >> like the right
> >> thing to do.)
> 
> Really worthwhile?  Is it going to do anything other than
> Collator.getInstance().compare(someString, node.getValue()) ?

Well, since Comparable is for the natural-order of the items,
if it were to be implemented by all 'nodes' in the JDOM tree,
I'd actually say that compareTo(), in my XPath case of things
would not be a lexical comparison, but rather document-order
comparison.

It's exactly that ambiguity as to exactly how things should
be compared that makes Comparable many times less-than-useful.

I'd vote -1.

	-bob




More information about the jdom-interest mailing list