コード例 #1
0
  @Override
  public ParameterValue<?> get(int pos) {
    if (pos < state.size) {
      final double value = state.min + pos * state.step;
      ParameterValue<?> result = null;

      switch (parameterType) {
        case Integer:
          result =
              ParameterValueFactory.createParameterValue(
                  dynamicValueAssignment.getParameter(), (int) Math.round(value));
          break;
        case Double:
          result =
              ParameterValueFactory.createParameterValue(
                  dynamicValueAssignment.getParameter(), value);
        default:
          break;
      }

      return result;
    } else {
      throw new IndexOutOfBoundsException(
          "Parameter value index " + pos + " is out of bound [0.." + state.size + "].");
    }
  }
コード例 #2
0
 @Override
 public ParameterDefinition getParameter() {
   return dynamicValueAssignment.getParameter();
 }