• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Enum values by 'string value'

 
Greenhorn
Posts: 14
C++ Notepad Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before I get flooded with "just use a map" replies, let me just say that I've always wondered if Java supports this type of operation

It's a bit hard for me to explain...but I want to produce these results:



//Loaded in the following array with my parser class



I hope this question isn't too cryptic...but I've been trying everything to no avail.

Thanks
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that you can use the java.lang.Enum#valueOf method to do that.

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After reading your post once again, I may have misunderstood what you want to do. Do yo mean that "enum test" does not exist, and you want to dynamically create it ?
 
Luc Lieber
Greenhorn
Posts: 14
C++ Notepad Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After banging my head against a wall til now I've kind of lost interest to see if this is possible to do, sorry for wasting the time.
 
reply
    Bookmark Topic Watch Topic
  • New Topic