1
0
Fork 0
PR1-Spreadsheet/Axel/src/de/hs_mannheim/informatik/spreadsheet/Cell.java

39 lines
891 B
Java

package de.hs_mannheim.informatik.spreadsheet;
//test
/**
* Part of a simplified spreadsheet system for the PR1 programming lab at Hochschule Mannheim.
* A cell needs to be able to hold a formula and a value
*
* @author Oliver Hummel
*/
public class Cell {
private String formula = "";
private String value = "";
public String getFormula() {
return formula;
}
public void setFormula(String formula) {
if (!formula.isEmpty())
this.formula = formula.toUpperCase().substring(1); // removes '=' at the beginning
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String toString() {
return String.format("%4s", value);
}
public boolean isEmpty() {
return value.isEmpty();
}
}