private List<Contact> contacts;
private File file;
private boolean dirty;
+ private String name;
public Card(File file, Format format) throws IOException {
this.file = file;
+ if (file != null) {
+ name = file.getName();
+ }
+
BufferedReader buffer = new BufferedReader(new FileReader(file));
List<String> lines = new LinkedList<String>();
for (String line = buffer.readLine(); line != null; line = buffer
}
load(lines, format);
+ dirty = false; // initial load, so no change yet
}
public List<Contact> getContacts() {
return dirty;
}
+ /**
+ * Return the name of this card.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
/**
* Notify that this element has unsaved changes.
*/