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


Groups > comp.lang.java.help > #1243

Re: Dynamic enums

Newsgroups comp.lang.java.help
From Linus Flustillbe <admin@nacs.dyndns-office.com>
Subject Re: Dynamic enums
References <4e94eeb1$0$16274$9a566e8b@news.aliant.net> <j72sn7$cl$1@dont-email.me> <j72t18$1u6$1@dont-email.me>
Date 2011-10-12 06:02 +0000
Message-ID <4e952d5d$0$14660$9a566e8b@news.aliant.net> (permalink)

Show all headers | View raw


On 2011-10-12, Eric Sosman <esosman@ieee-dot-org.invalid> wrote:
> On 10/11/2011 10:05 PM, Eric Sosman wrote:
>> [...]
>> No. The names of enum constants are compile-time artifacts,
>> just like the names of local variables. At run-time, all such
>> things have disappeared (well, they may survive in ancillary debug
>> data, but the C language has no access to such things).
>
>      Oh, ratzafratz: I forgot which newsgroup I was in.  The *Java*
> language has access to this sort of information via reflection.
> Still, the information is very nearly read-only, and reflection
> can't inject a new enum into the mix.  (Java can, of course, load
> a new .class with a new definition for the enum -- but that just
> introduces a different enum class that happens to have the same
> name, under the scope of a different classloader.)
>

So basically the answer is "no" which is what I thought.  Glad to have
caught this early.  Here's a good question for you...  
I'm using (for now) an ArrayList<lookup_type_object>() to store my
lookup objects.  This seemed like the best vehicle and iteration was as
easy as looking in the API docs.  Is there a better vehicle for storing
an indeterminate number of *objects* which allows for easy addition,
removal and iteration?


-- 
****************************************************************
* Usenet Impovement Project http://nacs.dyndns-office.com/usenet
****************************************************************

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


Thread

Dynamic enums Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-12 01:34 +0000
  Re: Dynamic enums Lew <lewbloch@gmail.com> - 2011-10-11 19:03 -0700
  Re: Dynamic enums Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-11 22:05 -0400
    Re: Dynamic enums Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-11 22:11 -0400
      Re: Dynamic enums Linus Flustillbe <admin@nacs.dyndns-office.com> - 2011-10-12 06:02 +0000
        Re: Dynamic enums markspace <-@.> - 2011-10-11 23:44 -0700
        Re: Dynamic enums Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-10-12 07:58 -0400
          Re: Dynamic enums markspace <-@.> - 2011-10-12 07:46 -0700
  Re: Dynamic enums markspace <-@.> - 2011-10-11 19:32 -0700
  Re: Dynamic enums Roedy Green <see_website@mindprod.com.invalid> - 2011-10-12 07:02 -0700

csiph-web