package edu.umich.soar.hpp;

/**
 * Abstract variable has a name and type
 */
public abstract class HPPVariable implements Comparable<HPPVariable> {
	
	/**
	 * A variable's type is just a string (used for console debugging)
	 * 
	 * @return variable type
	 */
	public abstract String getType();
	
	/**
	 * Supports read-only access to the variable name
	 * 
	 * @return variable name
	 */
	public String getName() {
		return myName;
	}
	
	/**
	 * Basic constructor - initialize variable name
	 * 
	 * @param name variable name
	 */
	public HPPVariable(String name) {
		myName = name;
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return getName();
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(HPPVariable v) {		
		return getName().compareTo(v.getName());
	}
	
	private final String myName;
}
