add generateParagraphsInfo method to Note.java

This commit is contained in:
astroshim 2015-11-30 17:47:06 +09:00
parent cb993914c4
commit 2989096fdc

View file

@ -293,6 +293,21 @@ public class Note implements Serializable, JobListener {
return paragraphs.get(paragraphs.size() - 1);
}
}
public List<Map<String, String>> generateParagraphsInfo (){
List<Map<String, String>> paragraphsInfo = new LinkedList<>();
synchronized (paragraphs) {
for (Paragraph p : paragraphs) {
Map<String, String> info = new HashMap<>();
info.put("id", p.getId());
info.put("status", p.getStatus().toString());
info.put("started", p.getDateStarted().toString());
info.put("finished", p.getDateFinished().toString());
paragraphsInfo.add(info);
}
}
return paragraphsInfo;
}
/**
* Run all paragraphs sequentially.