Results 1 to 3 of 3
  1. #1
    deepuhassan is offline Member
    Join Date
    Dec 2009
    Posts
    1
    Rep Power
    0

    Default Which would be better List iterator or accessing through index?

    Hi All,
    i have doubt regarding the usage of iterator.We stores a list of values in a arraylist.Inorder to access it right now we are using list iterator and taking the values and comparing the values with the existing key. If there is a match with the key,then we are using that particular value.

    The point is the arraylist contains dynamic data and the data might be in several thousands,but some how I could able to get the index of the value which exactly matches with key.

    I compared both approach and I couldn't find any problem with it.

    Since it is web application when the load increases,the performance is bit slow.

    So I need a resolution for this..

    Please help...

  2. #2
    renamed is offline Member
    Join Date
    Dec 2009
    Location
    Rio de Janeiro
    Posts
    38
    Rep Power
    0

    Default

    Do you really need to use iterator?
    Last edited by renamed; 12-17-2009 at 04:08 PM.
    Please don't laugh at my English... I'm trying my best! :)

  3. #3
    renamed is offline Member
    Join Date
    Dec 2009
    Location
    Rio de Janeiro
    Posts
    38
    Rep Power
    0

    Default

    If you need to know the index, you can go to each element with a simple for.
    Last edited by renamed; 12-17-2009 at 04:11 PM.
    Please don't laugh at my English... I'm trying my best! :)

Similar Threads

  1. Replies: 12
    Last Post: 11-05-2009, 08:12 AM
  2. [SOLVED] Writing an Iterator method in a custom list
    By xcallmejudasx in forum New To Java
    Replies: 2
    Last Post: 02-12-2009, 06:22 AM
  3. Accessing list out another class
    By Preethi in forum New To Java
    Replies: 23
    Last Post: 10-26-2008, 03:54 PM
  4. Creating an Iterator for Linked List
    By spanky in forum New To Java
    Replies: 3
    Last Post: 10-05-2008, 08:16 PM
  5. Accessing index.dat files
    By vissu007 in forum Networking
    Replies: 1
    Last Post: 07-01-2007, 05:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •