package wto.prito.inf66268.util;

import wto.prito.inf66268.exceptions.*;;


/**
 * @author Szymon Krzysztyniak
 */
public class Cell {
	/**
	 * value of the cell
	 */
	private String cellValue;
	
	public Cell(String cellValue){		
		this.cellValue = cellValue;
	}
	
	public String getCellValue(){
		return cellValue;
	}
	
	public void setCellValue(String value){
		cellValue = value;
	}
	
	/**
	 * Check if cell has an operation or only a number
	 * @return true if cell has operation
	 */
	public boolean isOperation(){
		if(cellValue.length() < 1)
			return false;
		return (cellValue.charAt(0) == '=')	;	
	}
	
	public float getNumericValue() throws NotANumberException{
		return Float.parseFloat(cellValue);
	}
}
