1. Can I use bitwise OR for Java Enums stackoverflow.comSuppose you have an enum Direction
Could I write a method that uses bitwise or's to compare multiple enums
|
2. Is there a way to bitwise-OR enums in Java? stackoverflow.comI'm using a state machine, and the code's getting really verbose when testing against a large number of possible states.
|
3. How can I combine 2 bits in a single field using an EnumSet? stackoverflow.comGiven a binary string coded on 1 byte, is it possible to map several of that byte's bits into an enum value ? |
4. FoHow do Enum where can have something be two of its values - like bitwise? forums.oracle.comI have some font objects and I want to make an enum for the styles: NORMAL, ITALIC, BOLD, BOLD+ITALIC. The last one is confusing me. If I make it an enum, how can i allow the variable to be two values (so allow adding them like bitwise)? And how do I make it so that FontStyles.values() can include the last one? ... |