
package innovimax.mixthem.arguments;

/**
* <p>This is the representation of a parameter value.</p>
* @author Innovimax
* @version 1.0
*/
public class ParamValue { 
	
	private final String text;
	private final int number;
	
	/**
	* Constructor
	* @param text The String value of the parameter.	
	*/ 	
	public ParamValue(String text) {
		this.text = text;
		this.number = -1;
	}

	/**
	* Constructor
	* @param number The Integer value of the parameter.	
	*/ 	
	public ParamValue(int number) {
		this.text = null;
		this.number = number;
	}
	
	/**
	* Returns the parameter value as a String.
	* @return The parameter value as a String
	*/
	public String stringValue() {
		return this.text;
	}

	/**
	* Returns the parameter value as an Integer.
	* @return The parameter value as an Integer
	*/
	public int intValue() {
		return this.number;
	}
	
	@Override
	public String toString() {
		return text != null ? text : Integer.toString(number);
	}

}

@@ -139,16 +139,25 @@
 %0Apublic 
+abstract 
 class Pa
@@ -170,12 +170,53 @@
 ue %7B
- 
 %0A%09
-%0A
+private static class ParamStringValue() %7B%0A%09
 %09pri
@@ -239,16 +239,17 @@
 g text;%0A
+%09
 %09private
@@ -253,190 +253,756 @@
 ate 
-final int number;%0A%09%0A%09/**%0A%09* Constructor%0A%09* @param text The 
+ParamStringValue(String text) %7B%0A%09%09%09this.text = text;%0A%09%09%7D%0A%09%09%0A%09%09@Override%0A%09%09public String asString()%C2%A0%7B%0A%09%09%09return this.text;%0A%09%09%7D%0A%09%09@Override%0A%09%09public int asInt() %7B%0A%09%09%09throw new UnsupportedOperationException(%22Param
 String
- v
+V
 alue 
-of the parameter.%09%0A%09*/ %09%0A%09public
+does not have an int representation%22);%0A%09%09%7D%0A%09%09@Override%0A%09%09public String toString() %7B%0A%09%09%09return this.text;%0A%09%09%7D%0A%09%7D%0A%09private static class
  Param
+Int
 Value(
-String text
+) %7B%0A%09%09private final int i;%0A%09%09private ParamIntValue(int i
 ) %7B%0A%09%09
+%09
 this.
-text = text;%0A%09%09this.number = -1
+i = i;%0A%09%09%7D%09%09%09%0A%09%09%0A%09%09@Override%0A%09%09public String asString()%C2%A0%7B%0A%09%09%09throw new UnsupportedOperationException(%22ParamIntValue does not have a String representation%22);%0A%09%09%7D%0A%0A%09%09@Override%0A%09%09public int asInt() %7B%0A%09%09%09return this.i;%0A%09%09%7D%0A%09%09%0A%09%09@Override%0A%09%09public String toString() %7B%0A%09%09%09return Integer.toString(i)
 ;%0A
+%09
 %09%7D%0A
+%09%7D%0A%09
 %0A%09/**%0A%09*
  Con
@@ -997,16 +997,24 @@
 %0A%09/**%0A%09*
+ private
  Constru
@@ -1024,64 +1024,130 @@
 r%0A%09*
- @param number The Integer value of the parameter.%09%0A%09*/ 
+/ %09%0A%09public ParamValue() %7B%7D%0A%09%0A%09public static ParamValue createString(String str) %7B%0A%09%09return new ParamStringValue(str);%0A%09%7D%0A
 %09%0A%09p
@@ -1144,32 +1144,39 @@
 );%0A%09%7D%0A%09%0A%09public 
+static 
 ParamValue(int n
@@ -1173,65 +1173,57 @@
 alue
-(int number) %7B%0A%09%09this.text = null;%0A%09%09this.number = number
+ createInt(int i) %7B%0A%09%09return new ParamIntValue(i)
 ;%0A%09%7D
@@ -1333,53 +1333,35 @@
 lic 
+abstract 
 String 
-s
+asS
 tring
-Value() %7B%0A%09%09return this.text;%0A%09%7D
+();
 %0A%0A%09/
@@ -1470,150 +1470,30 @@
 lic 
-int intValue() %7B%0A%09%09return this.number;%0A%09%7D%0A%09%0A%09@Override%0A%09public String toString() %7B%0A%09%09return text != null ? text : Integer.toString(number
+abstract int asInt(
 );%0A%09
-%7D%0A
 %0A%7D%0A

Update ParamValue.java