Top.Mail.Ru
March 13th, 2005 - Java developers — LiveJournal
? ?

Java developers

March 13th, 2005

01:06 pm - mikser - Using enums...

Hi! I have some problems with enum. :(

Part of program:
public enum State {EARTH, FOUNDATION, FLOOR, WALL, ROOF);

private State state;

public boolean addElement(){
    //state = (state.ordinal()++);
    if(state.compareTo(State.ROOF)>=0)return false;
    else return true;
}//boolean addElement


Should be pretty clear... I want to add element (basically to change "private State state" to the next one: from EARTH to FOUNDATION, from FOUNDATION to FLOOR etc and if it succeeded - return true; else - return false).

But I got problems with changing element to the next one (red color). I tried many times, read manuals, books, googled etc but without any success. I hope someone could help me with this easy (I guess) task. Thanks in advance!

03:50 pm - trajano - Funny/Stupid performance problem

I had a performance problem with the framework that I wrote the other day. Took me two days to find the problem too. I was wondering why a basic form submission takes about 10 seconds to submit one field. Turns out to be...
Read more...Collapse )
Powered by LiveJournal.com