* @author niki
*/
class CliReader extends BasicReader {
- @Override
public void read() throws IOException {
if (getStory() == null) {
throw new IOException("No story to read");
}
}
- @Override
- public void read(int chapter) {
+ public void read(int chapter) throws IOException {
+ if (getStory() == null) {
+ throw new IOException("No story to read");
+ }
+
if (chapter > getStory().getChapters().size()) {
System.err.println("Chapter " + chapter + ": no such chapter");
} else {
}
}
- @Override
- public void start(String type) {
+ public void browse(String source) {
List<MetaData> stories;
- stories = Instance.getLibrary().getList(type);
+ stories = getLibrary().getListBySource(source);
for (MetaData story : stories) {
String author = "";