Package java.lang

Examples of java.lang.NumberFormatException


  public ULongLong(BigInteger uLongLongValue) {
    if ((uLongLongValue.compareTo(ULongLong.MIN_VALUE) >= 0)&&(uLongLongValue.compareTo(ULongLong.MAX_VALUE) <= 0)) {
      this.shiftedValue = uLongLongValue.subtract(ULongLong.SHIFT_VALUE).longValue();
      this.originalValue = uLongLongValue;
    } else {
      throw new NumberFormatException(uLongLongValue+" is not in the range of (0 to 18,446,744,073,709,551,615).");
    }
  }
View Full Code Here


    }

  String s = sb.toString();
  Object n = matchNumber(s);
  if(n == null)
    throw new NumberFormatException("Invalid number: " + s);
  return n;
}
View Full Code Here

//                n = n.intValue();
//            }
        }       
        // CUSTOM NUMBERS end
        if (n == null)
            throw new NumberFormatException("Invalid number: " + s);
        return n;
    }
View Full Code Here

  private void setIterations(char ch[], int start, int length) {
    int n;
    try {
      n = Integer.parseInt(new String(ch, start, length));
      if (n < 0) {
        throw new NumberFormatException();
      }
    } catch (NumberFormatException e) {
      System.out.println("Error: the number of iterations is not a positive integer! "
          + "Setting it to 100.");
      n = 100;
View Full Code Here

    int n;
    try {
      n = Integer.parseInt(attribute);
      if (n < 0) {
        throw new NumberFormatException();
      }
    } catch (NumberFormatException e) {
      System.err.println("Error: the interval you specified is not a positive integer! "
          + "Setting it to 0. The diagnostic will only be performed only at the beginning.");
      n = 0;
View Full Code Here

  private void setNumberOfParticles(char ch[], int start, int length) {
    int n;
    try {
      n = Integer.parseInt(new String(ch, start, length));
      if (n < 0) {
        throw new NumberFormatException();
      }
    } catch (NumberFormatException e) {
      System.out.println("Error: particle number is not a positive integer! Setting n = 100.");
      n = 100;
    }
View Full Code Here

  private void setTimeStep(char ch[], int start, int length) {
    double t;
    try {
      t = Double.parseDouble(new String(ch, start, length));
      if (t < 0) {
        throw new NumberFormatException();
      }
    } catch (NumberFormatException e) {
      System.out.println("Error: time step is not a positive value! Setting it to 1.");
      t = 1;
    }
View Full Code Here

  private void setSimulationWidth(char ch[], int start, int length) {
    double w;
    try {
      w = Double.parseDouble(new String(ch, start, length));
      if (w < 0) {
        throw new NumberFormatException();
      }
    } catch (NumberFormatException e) {
      System.out.println("Error: simulation width is not a positive value! Setting it to 100.");
      w = 100;
    }
View Full Code Here

  private void setSimulationHeight(char ch[], int start, int length) {
    double h;
    try {
      h = Double.parseDouble(new String(ch, start, length));
      if (h < 0) {
        throw new NumberFormatException();
      }
    } catch (NumberFormatException e) {
      System.out.println("Error: simulation height is not a positive value! Setting it to 100.");
      h = 100;
    }
View Full Code Here

    int precision = (buffer[offset] & PRECISION_MASK) >> PRECISION_SHIFT;

    if((size+offset) >= buffer.length) {
      logger.error("Error extracting value - length={}, offset={}, size={}.",
          new Object[] { buffer.length, offset, size});
      throw new NumberFormatException();
    }
   
    int value = 0;
    int i;
    for (i = 0; i < size; ++i) {
View Full Code Here

TOP

Related Classes of java.lang.NumberFormatException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.