return new Integer(year);
else if (col == 2) {
Double amount = new Double(0.0);
boolean found = false;
int count = 0;
Budget budget = null;
while (!found && count<budgetList.size()) {
budget = (Budget)budgetList.get(count);
if (budget.getYear().intValue() == year && budget.getMonth().intValue() == month) {
amount = budget.getAmount();
}
count++;
}
return amount;
}
else if (col == 3) {
Double amount = new Double(0.0);
boolean found = false;
int count = 0;
while (!found && count<balanceList.size()) {
double[] record = (double[])balanceList.get(count);
if (year == record[0] && month == record[1]) {
amount = new Double(record[2]);
found = true;
}
count++;
}
return amount;
}
else if (col == 4) {
Double[] retVal = new Double[2];
retVal[0] = (Double)getValueAt(row, 2);
retVal[1] = (Double)getValueAt(row, 3);
return retVal;
}
else
return null;
}
public void setValueAt(Object value, int row, int column) {
Integer month = (Integer)getValueAt(row, 0);
Integer year = (Integer)getValueAt(row, 1);
Budget budget = null;
boolean found = false;
int count = 0;
while (!found && count < budgetList.size()) {
budget = (Budget)budgetList.get(count);
if (budget.getYear().intValue() == year.intValue() &&
budget.getMonth().intValue() == month.intValue()) {
found = true;
}
count++;
}
if (!found) {
budget = new Budget();
budget.setAccountID(currentAccount);
budget.setYear(year);
budget.setMonth(month);
budget.setActive(new Boolean(true));
budgetList.add(budget);
}
budget.setAmount((Double)value);
BudgetDAO budgetDAO = (BudgetDAO)daoFactory.getDAO("budget");
budgetDAO.store(budget, false);
}