Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.java.programmer > #5457

Re: Something Better than ArrayList

Date 2011-06-21 09:55 +0300
From Donkey Hottie <donkey@fredriksson.dy.fi>
Newsgroups comp.lang.java.programmer
Subject Re: Something Better than ArrayList
References <hoa007h62o1tas6h5p6qlls6i8i2nf9q84@4ax.com>
Message-ID <7rr5d8-iug.ln1@hurricane.fredriksson.dy.fi> (permalink)
Organization NBL Networks Oy

Show all headers | View raw


21.6.2011 8:34, Gene Wirchenko kirjoitti:
> Dear Java'ers:
> 
>      I have been using ArrayList to serve as an expandable array.  I
> have not cared about the searching efficency since the arrays have
> been small.
> 
>      Now, I need symbol table processing.  There will be a lot of
> lookups.  What class is like ArrayList in being an expandable array
> but that has an order?  I also want to have more than one data item
> per entry.  I am looking at
>           symbol name (which is what the array is to be sorted by)
>           symbol value
> and possibly something else by the time I think on this further.
> Symbol name and symbol value will be of type String though I would
> like a general answer.
> 
>      The name of the class is what I need.  I assume I can find the
> docs once I know what it is called.
> 
> Sincerely,
> 
> Gene Wirchenko

I think you need a Map<String,String>

That is the interface, the implementation could be
HashMap<String,String> or TreeMap<String,String>

HashMap does not keep ordering, but TreeMap does. Both offer the lookup
with symbol name though, and that is what you need, I think.



-- 

An exotic journey in downtown Newark is in your future.

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Something Better than ArrayList Gene Wirchenko <genew@ocis.net> - 2011-06-20 22:34 -0700
  Re: Something Better than ArrayList Donkey Hottie <donkey@fredriksson.dy.fi> - 2011-06-21 09:55 +0300
    Re: Something Better than ArrayList Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-06-21 09:00 +0000
      Re: Something Better than ArrayList Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-06-21 10:48 +0000
        Re: Something Better than ArrayList Tom Anderson <twic@urchin.earth.li> - 2011-06-21 22:57 +0100
  Re: Something Better than ArrayList Paul Cager <paul.cager@googlemail.com> - 2011-06-21 02:22 -0700
    Re: Something Better than ArrayList Gene Wirchenko <genew@ocis.net> - 2011-06-21 14:19 -0700
      Re: Something Better than ArrayList Tom Anderson <twic@urchin.earth.li> - 2011-06-21 22:56 +0100
        Re: Something Better than ArrayList Gene Wirchenko <genew@ocis.net> - 2011-06-21 16:39 -0700
  Re: Something Better than ArrayList Gene Wirchenko <genew@ocis.net> - 2011-06-21 07:51 -0700

csiph-web