package com.iskrembilen.quasseldroid;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * User: Stian
 * Date: 05.07.12
 * Time: 20:14
 */
public enum IrcMode {
    OWNER ("owner","q", 1),
    ADMIN ("admin","a", 2),
    OPERATOR ("operator","o", 3),
    HALF_OPERATOR ("half operator","h", 4),
    VOICE ("voice","v", 5),
    USER ("user","u", 6);

    public final String name;
    public final String shortName;
    public final int rank;

    IrcMode(String name, String shortName, int rank) {
        this.name = name;
        this.shortName = shortName;
        this.rank = rank;
    }
}

package com.iskrembilen.quasseldroid;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/**
 * User: Stian
 * Date: 05.07.12
 * Time: 20:14
 */
public enum IrcMode {
    /*
     * Declare in order of rank, this way values() will naturally
     * return the different modes based on rank
     */
    OWNER ("owner","q"),
    ADMIN ("admin","a"),
    OPERATOR ("operator","o"),
    HALF_OPERATOR ("half operator","h"),
    VOICE ("voice","v"),
    USER ("user",""); //This will work as a catch-all for unknown modes

    public final String modeName;
    public final String shortModeName;

    IrcMode(String modeName, String shortModeName) {
        this.modeName = modeName;
        this.shortModeName = shortModeName;
    }

}

Remove rank from IrcMode