I'm not that worried about the speed, I'm more worried about the size
both of the source and of the jar. Currently the source takes up 1.6M
and the jar 1.5M but with the new RTF features that source is 9.5M and
the jar 5.5M. With sizes like this it will be needed to create a jar for
PDF and another for RTF. 

Let's have a look at the current structure. In basectrlwords package the
classes are of the type:

public class RtfCtrlWordBase_ab extends RtfCtrlWordBase {
  public RtfCtrlWordBase_ab(RtfParser rtfParser){
    super(rtfParser, "ab", 0, false, RtfCtrlWordType.TOGGLE,
RtfCtrlWordPropertyType.UNIDENTIFIED);
  }
}

Just parameters that could be called directly in RtfCtrlWordBase
constructor.

In ctrlwords.document the classes are of the type:

public class RtfCtrlWord_ab extends RtfCtrlWordBase_ab {
  public RtfCtrlWord_ab(RtfParser rtfParser){
    super(rtfParser);
  }
}

Looks like it does exactly the same as the base class.

In RtfCtrlWordMgr.java we have:

add("ab", new RtfCtrlWord_ab(rtfParser));

In RtfCtrlWords.java we have:

if(!kwdTable.containsKey("ab")) kwdTable.put("ab", new
RtfCtrlWordBase_ab(rtfParser));

this coud be replaced with (changing the abstract and protected in
RtfCtrlWordBase):

kwdTable.put("ab", new RtfCtrlWordBase(rtfParser, "ab", 0, false,
RtfCtrlWordType.TOGGLE, RtfCtrlWordPropertyType.UNIDENTIFIED));


I think that 3600 classes could be eliminated without loss of
functionality and it would always be possible to extends RtfCtrlWordBase
for some specific uses. This would probably allow iText to be
distributed in a single jar.

Paulo


> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of Howard Shank
> Sent: Wednesday, December 05, 2007 3:47 PM
> To: Post all your questions about iText here
> Subject: Re: [iText-questions] RTF Parser update
> 
> Paulo,
> 
> The tests in the previous message were run in debug mode.
> 
> Running in release mode (no debug) the timings for creation 
> and population of the HastMap object are in the 60ms range.
> 
> Howard


Aviso Legal:
Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
informação confidencial ou legalmente protegida. A incorrecta transmissão desta 
mensagem não significa a perca de confidencialidade. Se esta mensagem for 
recebida por engano, por favor envie-a de volta para o remetente e apague-a do 
seu sistema de imediato. É proibido a qualquer pessoa que não o destinatário de 
usar, revelar ou distribuir qualquer parte desta mensagem. 

Disclaimer:
This message is destined exclusively to the intended receiver. It may contain 
confidential or legally protected information. The incorrect transmission of 
this message does not mean the loss of its confidentiality. If this message is 
received by mistake, please send it back to the sender and delete it from your 
system immediately. It is forbidden to any person who is not the intended 
receiver to use, distribute or copy any part of this message.


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to