Created
June 22, 2012 08:15
-
-
Save mishadoff/2971273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Assume all following objects have id-constructor | |
// Book (int id) { this.bookId = id; } | |
// first book with 1 page and 8 words | |
Book book1 = new Book(1); | |
ArrayList<Page> pages = new ArrayList<Page>(); // create holder for pages | |
Page page1 = new Page(1); // create page | |
pages.add(page1); // bind page to pages | |
ArrayList<Word> words = new ArrayList<Word>(); // create holder for words | |
// filling words list | |
words.add(new Word(1)); | |
words.add(new Word(2)); | |
// more words here | |
words.add(new Word(8)); | |
page1.setWords(words); // bind words to page | |
book1.setPages(pages); // bind pages to book |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment