public void setMode(int n) { if (type.hasModes()) { if (type.hasInstantModeSwitch()) { mode = n; } else if (pendingMode != n) { pendingMode = n;
public int setMode(String s) { for (int x = 0; x < type.getModes().length; x++) { if (type.getModes()[x].equals(s)) { setMode(x); return x;
    public void setMode(int n) {        if (type.hasModes()) {            if (type.hasInstantModeSwitch()) {                mode = n;            }            else if (pendingMode != n) {                pendingMode = n;            }        }    }