Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


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

Re: Something Better than ArrayList

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin3!goblin.stu.neva.ru!newsfeed3.funet.fi!newsfeed2.funet.fi!newsfeeds.funet.fi!fi.sn.net!newsfeed1.tdcnet.fi!news.song.fi!not-for-mail
Date Tue, 21 Jun 2011 09:55:23 +0300
From Donkey Hottie <donkey@fredriksson.dy.fi>
User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.1; fi; rv:1.9.2.17) Gecko/20110414 Lightning/1.0b2 Thunderbird/3.1.10 ThunderBrowse/3.3.5
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: Something Better than ArrayList
References <hoa007h62o1tas6h5p6qlls6i8i2nf9q84@4ax.com>
In-Reply-To <hoa007h62o1tas6h5p6qlls6i8i2nf9q84@4ax.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
Message-ID <7rr5d8-iug.ln1@hurricane.fredriksson.dy.fi> (permalink)
Lines 37
Organization NBL Networks Oy
NNTP-Posting-Host 213.157.94.92
X-Trace 1308639331 news.nbl.fi 2852 213.157.94.92:36540
X-Complaints-To abuse@nblnetworks.fi
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5457

Show key headers only | 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