Re: [Simple-support] implementing a progress bar
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2011-09-22 10:27:11
|
Yes, you need to know what your parsing, you could write a Visitor to check things like this. "element1" = 10% "element2" = 12% "element4" = 50% etc... With this you need to know the elements in advance. If you don't know them, then using an input steam with an upfront file size would be best. --- On Wed, 21/9/11, Aaron Digulla <di...@he...> wrote: > From: Aaron Digulla <di...@he...> > Subject: Re: [Simple-support] implementing a progress bar > To: sim...@li... > Received: Wednesday, 21 September, 2011, 11:28 AM > Am 21.09.2011 15:05, schrieb Krein, > Jörg: > > Hi, > > > > I need to add a progress bar to visualize the > (de)serialization process. > > Please give me some hints how to achive this. > > From what I understand one way is to use a visitor? > > A simple example would be very helpful. > > That depends on what you know. > > Do you know in advance how many XML elements the document > contains? > > If not, do you know the file size? > > If you know the latter, you can create an InputStream > (derived from > FilterInputStream) which updates a counter with the number > of bytes read > so far. > > That allows you to read this information from a second > thread or by > triggering a callback after a certain number of bytes have > been read. > > In the former case, you need to hook into the > (de)serialization process. > I'm not sure whether a visitor is really helpful here. > > Regards, > > -- > Aaron "Optimizer" Digulla a.k.a. Philmann Dark > "It's not the universe that's limited, it's our > imagination. > Follow me and I'll show you something beyond the limits." > http://blog.pdark.de/ > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT > infrastructure contains a > definitive record of customers, application performance, > security > threats, fraudulent activity and more. Splunk takes this > data and makes > sense of it. Business sense. IT sense. Common sense. > http://p.sf.net/sfu/splunk-d2dcopy1 > _______________________________________________ > Simple-support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simple-support > |