Article View: comp.lang.java
Article #581Re: Rename an object?
From: elidan1
Date: Fri, 24 Mar 2000 00:00
Date: Fri, 24 Mar 2000 00:00
38 lines
2285 bytes
2285 bytes
In article <oGvbOF8lsZk9Lz8npJGTR0DDKOLG@4ax.com>,
Sebastian Breier <Seba_B@gmx.net> wrote:
> Use a Hashtable. A Hashtable object saves relations between objects.
> So, you can, for example, set a string object for every object you
> want to rename.
>
> On Fri, 24 Mar 2000 13:01:03 -0000, "Scott Saunders"
> <scott@saunders179.freeserve.co.uk> wrote:
>
> >Can anyone please tell me how to take an object and give it a name
using a
> >string? For example, I have an object of type relation (my own class)
called
> >"rel1", and I want to give it a name like "My relation" so that I can
> >display this name in a JList instead of the actual object's name
("rel1").
> >
> >If anyone can help I'd appreciate it. Someone suggested using forname
in the
> >java.lang.class package, but I didn't understand it. I don't know if
it is
> >what I needed anyway. Please could you reply to sc0tt@talk21.com.
> >
> >Thanks,
> >Scott
> >
>
> ___________________________________________________________________
> If a train station is where the train stops, what is a workstation?
> This eMail is from Seba_B@gmx.net
>
If one uses java 1.2 HashMap (or even TreeMap if sorting is needed)
might be a better choice, if synchronization is not an issue, since they
are faster.
Sent via Deja.com http://www.deja.com/
Before you buy.
Technical Details
Message-ID:
<8bgaql$6pm$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8bfoup$eh2$1@news8.svr.pol.co.uk> <oGvbOF8lsZk9Lz8npJGTR0DDKOLG@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb99b,af49882d01fb7d16 X-Google-Attributes: gidfb99b,public X-Google-Thread: 10a146,af49882d01fb7d16 X-Google-Attributes: gid10a146,public X-Google-Thread: 113ae9,af49882d01fb7d16 X-Google-Attributes: gid113ae9,public X-Google-Thread: f5d71,af49882d01fb7d16 X-Google-Attributes: gidf5d71,public From: elidan1@my-deja.com Subject: Re: Rename an object? Date: 2000/03/24 Message-ID: <8bgaql$6pm$1@nnrp1.deja.com> X-Deja-AN: 601840086 References: <8bfoup$eh2$1@news8.svr.pol.co.uk> <oGvbOF8lsZk9Lz8npJGTR0DDKOLG@4ax.com> X-Http-Proxy: 1.0 x31.deja.com:80 (Squid/1.1.22) for client 213.8.252.156 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Mar 24 18:06:27 2000 GMT X-MyDeja-Info: XMYDJUIDelidan1 Newsgroups: comp.lang.java,comp.lang.java.help,comp.lang.java.programmer,cz.comp.lang.java X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I)