This could sound strange but actually is quite simple.
Short description: I have a class variable called
public static final String ACCELEROMETER_X = "AccX";
In one function I do this, which get me "ACCELEROMETER_X" from a enum (sensors is an arrayList of my enum).
for i...
columns = columns + sensors.get(i).name()
The point is I want to introduce in columns not "ACCELEROMETER_X", but "AccX". Any idea? I know I could do it using switch and cases but my enum has more than 30 values so Id rather prefer other "cleaner" way to do it.
enumis just syntactic sugar for a class, as Rohit has shown, then it all becomes easy.