Are there plans for ImmutableEnumSet in Java 7?
I want to have all the efficiencies of EnumSet and pass it around without worrying that somebody would modify it. ...
I want to have all the efficiencies of EnumSet and pass it around without worrying that somebody would modify it. ...
Currently, my project uses @Enumerated(EnumType.ORDINAL), so when I sort by this column, it is ordering based on the order in the enum, which works fine. But I need to add some additional values to the enum, which need to be inserted at different locations in the list of enum values and can't be just added to the bottom to maintain the c...
JAXB runtime is failing to create JAXBContext for a Class whose member variable is defined as @XmlElement(name = "EnumeraatioArvo") private Enum<?> eenum; How to handle such scenario in JAXB? ...
I've got the following enum: public enum myEnum { ONE("ONE"), TWO("TWO"); private String name; private myEnum(String name) { this.name = name; } @Override public String toString() { return name; } }; My question is why does the following evaluate to false? I suspect it has something to do...
So currently have an enumeration used on the status of an application. However, something feels off when using it against the ui. To many conversions between integer and string when populating drop downs. I could use an extension method or the type converter and continue to use the enum which will be helpful if an enum has multiple words...
I have following code import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.ui.UIObject; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.LayoutPanel; import com.google.gwt.user.client.ui.RootLayoutPanel; import com.google.gwt.user.cl...
Hey guys, I have a table in my database with an enum column with 3 values: ('Offline', 'Online', 'Expired') I want to be able to do an update that cycles the value of the this column to the next value in the list... and wrap back to the start. i.e. 'Offline' will change to 'Online' 'Online' will change to 'Expired' 'Expired' w...
Why does Phobos use enum to define constants? For example, in std.math: enum real E = 2.7182818284590452354L; Why not use a global immutable? What are the advantages/disadvantages of enum over immutable? ...
I am using PDO and prepared statements, but i cannot seem to get any results when comparing an ENUM field with an integer. Example: $db = new PDO('mysql:host=localhost;dbname=****', '***', '***'); $s = $db->prepare('SELECT id FROM t2 WHERE lang = ?'); $s->execute(array('en')); // Works print_r($s->fetchAll()); $s->exec...
$("#bc [id$=_dropdownID]").change(function() { if (this.value == '2' || this.value == '3') { $("#bc .pnl").show(); } else { $("#bc .pnl").hide(); } I have the following code in jQuery. Is there any way I can replace the hard coded constants 2 and 3 in the above code with a c# enum? Does jQuery support en...
By default, C# enums are stored as integers. I'd like to make it a short instead. Is there a way to do this? ...
Hi another silly simple question. I have noticed that in certain typedefs in Apple's frameworks use the symbols "<<" can anyone tell me what that means?: enum { UIViewAutoresizingNone = 0, UIViewAutoresizingFlexibleLeftMargin = 1 << 0, UIViewAutoresizingFlexibleWidth = 1 << 1, UIViewAutoresizin...
Is it possible to use an enum as a discriminator value when using SINGLE_TABLE inheritance strategy? ...
C++ enum question. So I have a list of files, and their IDs that I need to iterate over, and do stuff to. Most of the stuff is the same, but there are a few file-specific things that need to be done. I tried putting the file IDs in an enum, and iterating over that. Howver, the fileIDs are non contiguous, and jump around. Currently, I ...
I am constructing enum values that have a data structure like the following: enum MetaType { HUMAN( new MetaTypeAttribute(AttributeType.BODY, 1, 6), new MetaTypeAttribute(AttributeType.AGILITY, 1, 6), new MetaTypeAttribute(AttributeType.REACTION, 1, 6) ), ORK( new MetaTypeAttribute(AttributeType.BODY, 4, 9), new MetaTypeAtt...
Hi! I'm going to use enum flags for options to initialize my class. The enum is: namespace MCXJS { enum VARPARAM { STATIC = 1, CONST = 2 } //other things } If I'm right, in this case, to check for STATIC I need to do this: if (param & MCXJS::VARPARAM::STATIC) //... I know to do it this way: if (par...
I am doing a simple web page and I have a NurseForm entity. When the nurse sees a patient he/she fills this form. One of this form field is "Actions done" which is basically an enum with: public enum NurseAction { GIVE_MEDICINE, PERFORM_SUTURE, SPRAY_THERAPY, NEBULIZATIONS; } A nurse can perform more than one action so I have a p...
Hi Guys, Suppose i have the following 2 SQL tables: Foo Column DataType --------------------------- Title NVARCHAR(20) Body NVARCHAR(MAX) FooTypeId TINYINT FooType Column DataType -------------------------- FooTypeId TINYINT Name NVARCHAR(10) Now, im using Entity Framework 4.0 with...
I need to create a good/neutral/bad field. which one would be the more understandable/correct way. A binary field with null (1=good, null=neutral, 0=bad) An int (1=good, 2=neutral, 3=bad) An enum (good, neutral, bad) Any other It's only and informative field and I will not need to search by this. ...
Hi! It is possible to declare enums with custom values in Delphi 5 like this?: type MyEnum = (meVal1 = 1, meVal2 = 3); // compiler error Thanks! ...