[jdom-interest] Element Reference from Attribute

philip.nelson at omniresources.com philip.nelson at omniresources.com
Wed Nov 22 11:25:40 PST 2000

> In a singly-linked version, you could write a Builder that 
> tried to share 
> references to Attributes. In some cases, this could give a 
> great advantage
> in memory consumption. For example, say I have a dataset written as:
> <table>
>   <row>
>       <cell width=20>narrow</cell>
>       <cell width=40>wide</cell>
>   </row>
>   <row>
>      <cell width=20>narrow</cell>
>       <cell width=40>wide</cell>
>   </row>
>   ...
> </rable>
> You could have only two distinct attributes: Attribute("width",20) and
> Attribute("width",40). Normally, a table with 10k rows has 
> 20k attribute
> objects when it could have 2. 

And to figure out when to share the attribute reference or not you would do
And then when the second row's cell width changed you would do what?

As to the idea of a two level approach, would you have to rewrite the
inputters, outputters, builders to use the Builder you mention?  Isn't this
extra overhead as well for the most common thing that JDOM has to do?

More information about the jdom-interest mailing list