[jdom-interest] Fast Factory

Bradley S. Huffman hip at csa.cs.okstate.edu
Tue May 27 07:50:04 PDT 2003


=?iso-8859-1?Q?Hallvard_Tr=E6tteberg?= writes:

> I'd really like JDOM to change the internals to make my additions work,
> but it is difficult to argue that JDOM currently is wrong, only that id
> support was difficult to add without this change (the alternative would
> be to subclass ContentList, but then there was no way to control which
> ContentList class was instantiated (no Factory)).

Would Element having a internal structure like the following work?

    protected String name;
    protected transient Namespace namespace;
    protected transient List additionalNamespaces;
    protected Parent parent;
    protected Attribute[] attributes;
    protected int attributeSize;
    protected Child[] content;
    protected int contentSize;

Since Parent has index methods, fold ContentList and AttributeList into
Element and use those methods.

Brad



More information about the jdom-interest mailing list