001package edu.pdx.cs410J.grader.gradebook; 002 003import java.util.ArrayList; 004import java.util.List; 005 006/** 007 * The abstract superclass of several <code>notable</code> classes. It 008 * is the result of refactoring some code. 009 * 010 * @author David Whitlock 011 * @since Summer 2007 012 */ 013public abstract class NotableImpl implements Notable { 014 015 private List<String> notes = new ArrayList<String>(); 016 private boolean dirty; 017 018 /** 019 * Returns notes about this <code>Assignment</code> 020 */ 021 public List<String> getNotes() { 022 return this.notes; 023 } 024 025 /** 026 * Adds a note about this <code>Assignment</code> 027 */ 028 public void addNote(String note) { 029 this.setDirty(true); 030 this.notes.add(note); 031 } 032 033 public void removeNote(String note) { 034 this.setDirty(true); 035 this.notes.remove(note); 036 } 037 038 /** 039 * Sets the dirtiness of this <code>Assignment</code> 040 */ 041 public void setDirty(boolean dirty) { 042 this.dirty = dirty; 043 } 044 045 /** 046 * Returns <code>true</code> if this <code>Assignment</code> has been 047 * modified. 048 */ 049 public boolean isDirty() { 050 return this.dirty; 051 } 052 053 /** 054 * Marks this <code>Assignment</code> as being clean 055 */ 056 public void makeClean() { 057 this.setDirty(false); 058 } 059 060 061}