Re: [Sax-devel] Exceptions in Attribues(2), AttributesImpl
Brought to you by:
dmegginson
From: Paul B. <pr...@fi...> - 2003-11-16 02:59:02
|
Hi, Karl -- > Is there any good reason I have overlooked why it should > be the way it is? The by-name getters are used for the purpose of testing for the presence of an attribute as much as getting its value, and something like this: String s = atts.getValue("foo"); if (s != null) { doStuff(s); } is preferable to something like this: if (isSet("foo")) { String s = atts.getValue("foo"); doStuff(s); } If for nothing else, the former is more in the habit of Java programmers, but also it saves two traversals of the internal data structure. (The same would be true for an implementation of Attributes backed by Collection APIs.) My $0.02. -- Paul |