Example usage for java.lang NumberFormatException NumberFormatException

List of usage examples for java.lang NumberFormatException NumberFormatException

Introduction

In this page you can find the example usage for java.lang NumberFormatException NumberFormatException.

Prototype

public NumberFormatException() 

Source Link

Document

Constructs a NumberFormatException with no detail message.

Usage

From source file:org.clipsmonitor.gui.MapGeneratorTopComponent.java

private void ExecAddPath() {

    final int Success = 0;
    final int IllegalStartCell = 1;
    final int IllegalPerson = 2;
    final int PersonOverride = 3;

    try {/*from   ww w . j  a v  a 2 s.  com*/
        int wait = Integer.parseInt(WaitTime.getText());
        if (wait < 0) {
            throw new NumberFormatException();
        }

        int result = model.AddNewPathToPerson(state, wait);
        switch (result) {

        case Success:
            model.log("Path aggiunto correttamente");
            actualPath = model.getLastPathOfPerson(state);
            String[][] move = model.getMoveCellMap(actualPath, -1);
            model.ApplyUpdateOnMoveMap(move);
            model.CopyToActive(model.getMove());
            PreviewMap.repaint();
            MakePersonList();
            MakeStepList(-1);
            MakeMoveList(-1, -1, "all");
            MakePathList(-1);
            setListEnable();
            break;
        case IllegalStartCell:
            model.error("Illegal start cell");
            break;
        case IllegalPerson:
            model.error("Illegal Person");
            break;
        case PersonOverride:
            model.error("Person ovveride");

            break;

        }
    } catch (NumberFormatException er) {
        model.error("Valore di Waitstep non valido: Input deve essere necessariamente un intero positivo");
    }

    updateLogArea();
}

From source file:ffx.algorithms.RotamerOptimization.java

public int nameToNumber(String residueString, Residue residues[]) throws NumberFormatException {
    int ret = -1;
    for (int x = 0; x < residues.length; x++) {
        if (residueString.equals(residues[x].toString())) {
            ret = x;//from w ww .ja va2 s .  c o m
            break;
        }
    }
    if (ret == -1) {
        throw new NumberFormatException();
    }
    return ret;
}