Home of: [Atelier "FUJIGURUMA"] >> [PageMixer hosted by SourceForge.net]

SEE "For Readers of English Version",
or Japanese version of this page

Fixed object

This section explains that how to reduce handling cost for correction of Token or Attribute.

Class names

In this document, abbreviated class names are used. Complete names are shown below.

NotationFull name
Token jp.ne.dti.lares.foozy.pagemixer.Token
Producer jp.ne.dti.lares.foozy.pagemixer.mixer.Producer
MutableStartTagToken jp.ne.dti.lares.foozy.pagemixer.MutableStartTagToken
MutableProducer jp.ne.dti.lares.foozy.pagemixer.mixer.MutableProducer
FixedStartTagToken jp.ne.dti.lares.foozy.pagemixer.FixedStartTagToken
FixedProducer jp.ne.dti.lares.foozy.pagemixer.mixer.FixedProducer

Ordinary design

Usually, if you do not know how many objects are contained, it is not so bad to use ArrayList and Iterator gotten from them for containing them and scanning them.

But once number of objects is fixed, array is faster and more efficient than ArrayList and Iterator, even though array resizing is very difficult.

Decision in PageMixer

In PageMixer, Token and Producer classes provide createFixed() method.

Some derived classes of them, MutableStartTagToken or MutableProducer for example, create fixed one from themselvs. Fixed one, FixedStartTagToken or FixedProducer for example, contain elements of them in array.

After building/modifying, you can use fixed one gotten from createFixed() of it for scanning efficiency.