package innovimax.mixthem.arguments;

/**
* <p>This is a detailed enumeration of additional rule parameters.</p>
* @author Innovimax
* @version 1.0
*/
public enum RuleParam { 
	_RANDOM_SEED("seed", false, ParamType._INTEGER),
	_JOIN_COL1("col1", false, ParamType._INTEGER),
	_JOIN_COL2("col2", false, ParamType._INTEGER);

	private final String name;
	private final boolean required;
	private final ParamType type;

	private RuleParam(String name, boolean required, ParamType type) {
		this.name = name;
		this.required = required;
		this.type = type;
	}

	/**
	* Returns the alias name of this parameter.
	* @return The alias name of this parameter
	*/
	public String getName() {
		return this.name;
	}

	/**
	* Returns true if the parameter is required.
	* @return True if the parameter is required
	*/
	public boolean isRequired() {
		return this.required;
	}

	/**
 	* Returns true if the parameter value is correct.
 	* @param value The value of the parameter on command line
 	* @return Returns true if the parameter value is correct
 	*/
	boolean checkValue(String value) {
		switch (this.type) {
        	case _INTEGER:
            	try {
            		Integer.parseInt(value);
            		return true;
            	} catch (Exception e) {
            		return false;
            	}
            default:
            	return true;
		}
	}

}

@@ -1341,10 +1341,502 @@
 %09%09%7D%0A%09%7D%0A%0A
+%09/**%0A %09* Returns the %7B@link ParamValue%7D representation of the parameter value.%0A %09* @param value The value of the parameter on command line%0A %09* @return The %7B@link ParamValue%7D representation of the parameter value%0A %09*/%0A%09ParamValue createValue(String value) throws NumberFormatException %7B%0A%09%09switch (this.type) %7B%0A%09%09%09case _INTEGER:%09%09%09%09%0A            %09%09%09return new ParamValue(Integer.parseInt(value));%0A            %09%09%09break;%0A            %09%09default:%0A            %09%09%09return new ParamValue(value);%0A%09%09%7D%0A%09%7D%0A%0A
 %7D%0A

add method