Package javaEffect

Examples of javaEffect.ErrNegativeNumber


   * @throws ErrNegativeNumber
   */
  public void setCost(int cost) throws ErrNegativeNumber {

    if (cost < 0)
      throw new ErrNegativeNumber("The cost can't be negative!");

    this.cost = cost;
  }
View Full Code Here


          "You didn't enter a name for a planet in the configuration file.");
    }
    this.name = name;

    if (size <= 0) {
      throw new ErrNegativeNumber(
          "You enter a negative number of inhabitants in the configuration file.");
    }
    this.inhabitants = size;

    this.character = new ArrayList<Object>();
View Full Code Here

  public void setInhabitants(int inhabitants) throws ErrNegativeNumber {

    if (inhabitants >= 0)
      this.inhabitants = inhabitants;
    else {
      throw new ErrNegativeNumber("The number of inhabitants is negative");
    }
  }
View Full Code Here

TOP

Related Classes of javaEffect.ErrNegativeNumber

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.