[jdom-interest] Text class (Question)
Elliotte Rusty Harold
elharo at metalab.unc.edu
Mon May 28 06:08:18 PDT 2001
At 12:17 PM +0200 5/28/01, ecky wrote:
>If the reason for implementing this class is to abstract from the type of
>string (i.e. character based or unicode) that you are using, do you manage
>it with this class? It seems to me that it's api still depends on String and
>it's
>implementation, as the parameter values and the return values are still of
>type String. So what does it change?
The API uses String because programmers will want to use it that way.
String is simple and straightforward and familiar for many use cases.
The implementation uses String because that's the quick and dirty
solution, but it's all private so if we want to change it later for
either performance or conformance we can.
The reason for this class is also not simply to avoid using String.
It's to make the navigation much cleaner by providing methods like
getParent() and insuring that the same object does not occupy
multiple places in the node structure.
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| The XML Bible (IDG Books, 1999) |
| http://metalab.unc.edu/xml/books/bible/ |
| http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://metalab.unc.edu/javafaq/ |
| Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/ |
+----------------------------------+---------------------------------+
More information about the jdom-interest
mailing list