The Artima Developer Community
Sponsored Link

Java Answers Forum
Performance comparison between methods of TreeMap

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
amit

Posts: 1
Nickname: amit171
Registered: Oct, 2004

Performance comparison between methods of TreeMap Posted: Oct 11, 2004 12:09 AM
Reply to this message Reply
Advertisement
Hello,
Do you know which way to access TreeMap is quicker?
(children in the following code samples is a TreeMap).
Option 1)
for (Iterator iter = children.entrySet().iterator(); iter.hasNext() {
Node n = (Node) ((Map.Entry) iter.next()).getValue();
}
option 2)
for(Iterator iter = children.values().iterator();iter.hasNext() {
Node n = (Node) iter.next();
}

Thanks in advance!
Amit

Topic: new to JavaBeans Previous Topic   Next Topic Topic: Problem!

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use