/**
 * 
 */
package dspl.intermediate.variable;

import dspl.intermediate.variable.primitive.Complex;

/**
 * DSPLComplex is the DSPL Variable for Complex numbers/arrays
 * @author David
 */
public class DSPLComplex extends Variable {
	public final static int COMPONENT_REAL = 0; 
	public final static int COMPONENT_IMAG = 1;
	/* (non-Javadoc)
	 * @see dspl.intermediate.variable.Variable#Variable(int)
	 */
	public DSPLComplex(int numElements) {
		super(numElements);
	}

	/* (non-Javadoc)
	 * @see dspl.intermediate.variable.Variable#isNumeric()
	 */
	public boolean isNumeric() {
		return true;
	}

	/* (non-Javadoc)
	 * @see dspl.intermediate.variable.Variable#getByteSize()
	 */
	public int getDataTypeByteSize() {
		return 8; 
	}

	/* (non-Javadoc)
	 * @see dspl.intermediate.variable.Variable#getVariableDataType()
	 */
	public int getDataType() {
		return Variable.DATA_TYPE_COMPLEX;
	}

	/* (non-Javadoc)
	 * @see dspl.intermediate.variable.Variable#convertToObject(java.lang.String)
	 */
	public Object convertToObject(String strValue) {
		throw new Error("Error: convertToObject(String) called on " + this.getClass().toString()); 
	}
	
	/* (non-Javadoc)
	 * @see dspl.intermediate.variable.Variable#convertToObject(java.lang.String,java.lang.String)
	 */
	public Object convertToObject(String strValue1, String strValue2) {
		//return new DSPLComplex(strValue1, strValue2); 
		return new Complex(strValue1, strValue2);
	}

	/* (non-Javadoc)
	 * @see dspl.intermediate.variable.Variable#isNaturalNum
	 */
	public boolean isNaturalNum() {
		return false; 
	}
}
