private static Class<?> getRestrictionClass(Parameter<?> opt) { return opt instanceof ClassParameter ? ((ClassParameter<?>) opt).getRestrictionClass() // : opt instanceof ClassListParameter ? ((ClassListParameter<?>) opt).getRestrictionClass() // : null; }
@Override public String getDefaultValueAsString() { return canonicalClassName(getDefaultValue(), getRestrictionClass()); } }
/** * Constructor. */ public RemainingOptions() { super(REMAINING_OPTIONS_ID); super.setOptional(true); } }
@Override public int size() { return getValue().length; }
/** * Constructs a flag object with the given optionID. * <p> * If the flag is not set its value is "false". * * @param optionID the unique id of the option */ public Flag(OptionID optionID) { super(optionID); setOptional(true); setDefaultValue(Boolean.FALSE); }
/** * Constructs a vector list parameter with the given name and description. * * @param optionID Option ID * @param constraint Constraint * @param defaultValue Default value */ public DoubleArrayListParameter(OptionID optionID, ParameterConstraint<List<double[]>> constraint, List<double[]> defaultValue) { super(optionID, defaultValue); addConstraint(constraint); }
/** * Constructs a file parameter with the given optionID, file type, and * optional flag. * * @param optionID optionID the unique id of the option * @param fileType the file type of this file parameter * @param optional specifies if this parameter is an optional parameter */ public FileParameter(OptionID optionID, FileType fileType, boolean optional) { this(optionID, fileType); setOptional(optional); }
@Override public String getDefaultValueAsString() { if(defaultValue == RandomFactory.DEFAULT) { return GLOBAL_RANDOM_STR; } return super.getDefaultValueAsString(); } }
@Override public Object getGivenValue() { if(instance != null) { return instance; } else { return super.getGivenValue(); } } }
/** * Return a description of known valid classes. * * @see de.lmu.ifi.dbs.elki.utilities.optionhandling.parameters.AbstractParameter#getValuesDescription() */ @Override public String getValuesDescription() { if(restrictionClass != null && restrictionClass != Object.class) { return restrictionString(); } return ""; }
/** * Constructs a vector list parameter with the given name and description. * * @param optionID Option ID * @param constraint Constraint * @param optional Optional flag */ public DoubleArrayListParameter(OptionID optionID, ParameterConstraint<List<double[]>> constraint, boolean optional) { super(optionID, optional); addConstraint(constraint); }
/** * Constructs a file parameter with the given optionID, file type, and * optional flag. * * @param optionID optionID the unique id of the option * @param fileType the file type of this file parameter * @param optional specifies if this parameter is an optional parameter */ public FileParameter(OptionID optionID, FileType fileType, boolean optional) { this(optionID, fileType); setOptional(optional); }
@Override public String getDefaultValueAsString() { if (defaultValue == RandomFactory.DEFAULT) { return "global random"; } return super.getDefaultValueAsString(); } }
/** * Constructs a vector list parameter with the given name and description. * * @param optionID Option ID * @param constraint Constraint * @param optional Optional flag */ public DoubleArrayListParameter(OptionID optionID, ParameterConstraint<List<double[]>> constraint, boolean optional) { super(optionID, optional); addConstraint(constraint); }
@Override public String getDefaultValueAsString() { if(defaultValue == RandomFactory.DEFAULT) { return GLOBAL_RANDOM_STR; } return super.getDefaultValueAsString(); } }
/** * Constructs a vector list parameter with the given name and description. * * @param optionID Option ID * @param constraint Constraint */ public DoubleArrayListParameter(OptionID optionID, ParameterConstraint<List<double[]>> constraint) { super(optionID); addConstraint(constraint); }
/** * Constructs a vector list parameter with the given name and description. * * @param optionID Option ID * @param constraint Constraint * @param optional Optional flag */ public DoubleArrayListParameter(OptionID optionID, ParameterConstraint<List<double[]>> constraint, boolean optional) { super(optionID, optional); addConstraint(constraint); }
/** * Constructs a vector list parameter with the given name and description. * * @param optionID Option ID * @param constraint Constraint */ public DoubleArrayListParameter(OptionID optionID, ParameterConstraint<List<double[]>> constraint) { super(optionID); addConstraint(constraint); }