|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectBook
public class Book
This Book class represents a collection of pages. The Pages must all be unique and have positive numbers, but they do not need to be consecutive. The adventure should start on Page 1.
| Constructor Summary | |
|---|---|
Book()
Create an empty Book with no Pages |
|
Book(java.lang.String fileName)
Creates a Book from the text file with the supplied name. |
|
| Method Summary | |
|---|---|
void |
addPage(Page newPage)
Add the supplied page. |
int |
getNumberOfPages()
Return the total number of Pages |
Page |
getPage(int pageNumber)
Return the page with the given Page number. |
void |
outputBookToHTML(java.lang.String adventureName)
Creates directory with the suppied name and fills it with an .html representation of the game book |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Book(java.lang.String fileName)
fileName - the name of the file to read from.
AdventureException - Will crash if no such file exists or if the file has the
wrong formatpublic Book()
| Method Detail |
|---|
public Page getPage(int pageNumber)
pageNumber - the number of the desired Page
AdventureException - Will crash if the Book has no Page with the requested number.public void addPage(Page newPage)
newPage - the Page to add to the Book
AdventureException - Will crash if the supplied Page is null, if it has a page
number that is less than one, or if the Book already has a
Page with that number.public int getNumberOfPages()
public void outputBookToHTML(java.lang.String adventureName)
adventureName - The name for the folder and the .html files.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||