🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by Scott Saunders Fri, 24 Mar 2000 00:00
Rename an object?
#579
Author: Scott Saunders
Date: Fri, 24 Mar 2000 00:00
11 lines
1563 bytes
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
Re: Rename an object?
#580
Author: Sebastian Breier
Date: Fri, 24 Mar 2000 00:00
23 lines
1932 bytes
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
Re: Rename an object?
#581
Author: elidan1
Date: Fri, 24 Mar 2000 00:00
38 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads