Package de.lmu.ifi.dbs.elki.utilities.optionhandling

Examples of de.lmu.ifi.dbs.elki.utilities.optionhandling.WrongParameterValueException


   */
  @Override
  public void test() throws ParameterException {
    if(first.isDefined() && second.isDefined()) {
      if(first.getValue().doubleValue() >= second.getValue().doubleValue()) {
        throw new WrongParameterValueException("Global Parameter Constraint Error: \n" + "The value of parameter \"" + first.getName() + "\" has to be less than the" + "value of parameter \"" + second.getName() + "\"" + "(Current values: " + first.getName() + ": " + first.getValue().doubleValue() + ", " + second.getName() + ": " + second.getValue().doubleValue() + ")\n");
      }
    }
  }
View Full Code Here


    if(!list.isDefined() || !length.isDefined()) {
      return;
    }

    if(list.getListSize() != length.getValue()) {
      throw new WrongParameterValueException("Global Parameter Constraint Error." + "\nThe size of the list parameter \"" + list.getName() + "\" must be " + length.getValue() + ", current size is " + list.getListSize() + ". The value is defined by the integer parameter " + length.getName() + ".\n");
    }
  }
View Full Code Here

     *
     */
    @Override
    public void test(Number t) throws ParameterException {
        if (t.doubleValue() >= constraintValue.doubleValue()) {
            throw new WrongParameterValueException("Parameter Constraint Error: \n"
                + "The parameter value specified has to be less than " + constraintValue.toString()
                + ". (current value: " + t.doubleValue() + ")\n");
        }
    }
View Full Code Here

        if(!first) {
          constraintSize = listParam.getListSize();
          first = true;
        }
        else if(constraintSize != listParam.getListSize()) {
          throw new WrongParameterValueException("Global constraint errror.\n" + "The list parameters " + OptionUtil.optionsNamesToString(parameters) + " must have equal list sizes.");
        }
      }
    }
  }
View Full Code Here

     *
     */
    @Override
    public void test(Number t) throws ParameterException {
        if (t.doubleValue() <= constraintValue.doubleValue()) {
            throw new WrongParameterValueException("Parameter Constraint Error:\n"
                + "The parameter value specified has to be greater than "
                + constraintValue.toString() +
                ". (current value: " + t.doubleValue() + ")\n");
        }
    }
View Full Code Here

  @Override
  public void test(Number t) throws ParameterException {
    // lower value
    if(lowBoundary.equals(IntervalBoundary.CLOSE)) {
      if(t.doubleValue() < lowConstraintValue.doubleValue()) {
        throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "equal to or greater than " + lowConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
      }
    }
    else if(lowBoundary.equals(IntervalBoundary.OPEN)) {
      if(t.doubleValue() <= lowConstraintValue.doubleValue()) {
        throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "greater than " + lowConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
      }
    }

    // higher value
    if(highBoundary.equals(IntervalBoundary.CLOSE)) {
      if(t.doubleValue() > highConstraintValue.doubleValue()) {
        throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "equal to or less than " + highConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
      }
    }
    else if(highBoundary.equals(IntervalBoundary.OPEN)) {
      if(t.doubleValue() >= highConstraintValue.doubleValue()) {
        throw new WrongParameterValueException("Parameter Constraint Error: \n" + "The parameter value specified has to be " + "less than " + highConstraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
      }
    }
  }
View Full Code Here

     *
     */
    @Override
    public void test(Number t) throws ParameterException {
        if (t.doubleValue() > constraintValue.doubleValue()) {
            throw new WrongParameterValueException("Parameter Constraint Error: \n"
                + "The parameter value specified has to be less equal than "
                + constraintValue.toString() + ". (current value: " + t.doubleValue() + ")\n");
        }
    }
View Full Code Here

    for(Parameter<?,?> p : parameters) {
      if(p.isDefined()) {
        return;
      }
    }
    throw new WrongParameterValueException("Global Parameter Constraint Error.\n" + "At least one of the parameters " + OptionUtil.optionsNamesToString(parameters) + " has to be set.");
  }
View Full Code Here

    Set<Object> numbers = new HashSet<Object>();

    for(Parameter<?, ?> param : parameters) {
      if(param.isDefined()) {
        if(!numbers.add(param.getValue())) {
          throw new WrongParameterValueException("Global Parameter Constraint Error:\n" + "Parameters " + OptionUtil.optionsNamesToString(parameters) + " must have different values. Current values: " + OptionUtil.parameterNamesAndValuesToString(parameters) + ".\n");
        }
      }
    }
  }
View Full Code Here

   */
  @Override
  public void test() throws ParameterException {
    if(first.isDefined() && second.isDefined()) {
      if(first.getValue().doubleValue() > second.getValue().doubleValue()) {
        throw new WrongParameterValueException("Global Parameter Constraint Error: \n" + "The value of parameter \"" + first.getName() + "\" has to be less equal than the value of parameter \"" + second.getName() + " \"." + "(Current values: " + first.getName() + ": " + first.getValue().doubleValue() + ", " + second.getName() + ": " + second.getValue().doubleValue() + ")\n");
      }
    }
  }
View Full Code Here

TOP

Related Classes of de.lmu.ifi.dbs.elki.utilities.optionhandling.WrongParameterValueException

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.