Article View: borland.public.jbuilder.java.api
Article #1342Re: Java Properties vs XML
From: Dan Tran
Date: Tue, 12 Mar 2002 17:22
Date: Tue, 12 Mar 2002 17:22
30 lines
2214 bytes
2214 bytes
Thank you You are greate!! -Dan "John McGrath [TeamB]" <ng-b@JPMcGrath.net> wrote in message news:MPG.16f7eb34e5b57b2f98b42d@newsgroups.borland.com... > On Mon, 11 Mar 2002 21:23:15 -0800, Dan Tran wrote: > > > Could you enlighten me why java properies is > > faster interm of look up? > > The Java Properties class is a HashTable, which offers fairly quick > lookup. A DOM tree is a tree structure, and if you are using simple > name value pairs, I presume the properties would all be children of > the root node, so the lookup would be sequential. A HashTable should > give you much better performance than sequential lookup. > > Of course, if you were loading the properties from a DOM tree and doing > a significant number of lookups, you would probably want to push them > into a HashTable (or HashMap) to speed things up. The result would be > the same speed as using the Properties object. > > -- > Regards, > > John McGrath [TeamB] > > --------------------------------------------------- > Before sending me e-mail, please read: > http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<3c8e399b$1_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.dpn.de!news-out3.f.via-net-works.de!news-in2.f.via-net-works.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnewsReferences:
<3c8bd80c$1_1@dnews> <MPG.16f72e0efc162bab98b428@newsgroups.borland.com> <3c8d911b$1_1@dnews> <MPG.16f7eb34e5b57b2f98b42d@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,f99390192887b3fa X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-03-12 10:22:57 PST From: "Dan Tran" <danttran@hotmail.com> Newsgroups: borland.public.jbuilder.java.api References: <3c8bd80c$1_1@dnews> <MPG.16f72e0efc162bab98b428@newsgroups.borland.com> <3c8d911b$1_1@dnews> <MPG.16f7eb34e5b57b2f98b42d@newsgroups.borland.com> Subject: Re: Java Properties vs XML Date: Tue, 12 Mar 2002 09:22:09 -0800 Lines: 32 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 65.113.98.34 Message-ID: <3c8e399b$1_2@dnews> X-Trace: dnews 1015953819 65.113.98.34 (12 Mar 2002 09:23:39 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!isdnet!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!newsfeed.dpn.de!news-out3.f.via-net-works.de!news-in2.f.via-net-works.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews