/**
 * An argument is a literal value or variable name.
 * Several arguments are combined with operators to make an expression.
 */

/*
 * $Id$
 */

package net.sourceforge.mapyrus;

import java.lang.String;

public class Argument
{
	public static final int NUMERIC = 0;
	public static final int STRING = 1;
	public static final int VARIABLE = 2;
	
	private int mType;
	private double mNumericValue;
	private String mStringValue;
	private String mVarname;
	
	/**
	 * Create a new numeric argument.
	 * @param d is value for this argument.
	 */
	public Argument(double d)
	{
		mType = NUMERIC;
		mNumericValue = d;
	}
	
	/**
	 * Create a new string argument or variable name.
	 * @param type is STRING to create a string argument, or VARIABLE to create
	 * a reference to a variable.
	 */
	public Argument(int type, String s)
	{
		mType = type;
		if (type == STRING)
			mStringValue = s;
		else
			mVarname = s;
	}

	/**
	 * Returns type of argument.
	 * @return either NUMERIC, STRING, or VARIABLE.
	 */	
	public int getType()
	{
		return(mType);
	}
	
	/**
	 * Returns value of numeric argument.
	 * @return numeric argument value.
	 */
	public double getNumericValue()
	{
		return(mNumericValue);
	}
	
	/**
	 * Returns value of string argument.
	 * @return string argument value.
	 */
	public String getStringValue()
	{
		return(mStringValue);
	}

	/**
	 * Returns variable name reference of argument.
	 * @return name of variable containing value for this argument.
	 */	
	public String getVariableName()
	{
		return(mVarname);
	}
}

@@ -1,12 +1,88 @@
+/*%0A * $Id$%0A */%0A%0Apackage net.sourceforge.mapyrus;%0A%0Aimport java.lang.String;%0A%0A
 /**%0A * An ar
@@ -125,16 +125,66 @@
 e name.%0A
+ * Each field read from a dataset is an argument.%0A
  * Sever
@@ -196,18 +196,21 @@
 guments 
-ar
+can b
 e combin
@@ -252,90 +252,66 @@
 sion
-.
 %0A *
-/%0A%0A/*%0A * $Id$%0A */%0A%0Apackage net.sourceforge.mapyrus;%0A%0Aimport java.lang.String;%0A
+ For example, '2 * a + 7' contains three arguments.%0A */
 %0Apub
@@ -445,16 +445,55 @@
 LE = 2;%0A
+%09public static final int GEOMETRY = 3;%0A
 %09%0A%09priva
@@ -1669,11 +1669,324 @@
 ame);%0A%09%7D
+%0A%0A%09/**%0A%09 * Set argument to a numeric value.%0A%09 * @param d value to set.%0A%09 */%09%0A%09public void setNumericValue(double d)%0A%09%7B%0A%09%09mType = NUMERIC;%0A%09%09mNumericValue = d;%0A%09%7D%0A%09%0A%09/**%0A%09 * Set argument to a string.%0A%09 * @param s value to set.%0A%09 */%09%0A%09public void setStringValue(String s)%0A%09%7B%0A%09%09mType = STRING;%0A%09%09mStringValue = s;%0A%09%7D
 %0A%7D%0A

Add set methods, geometry type.