1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

introduced BookWithAuthorsTree class

This commit is contained in:
Nikolay Pultsin 2013-02-08 08:27:46 +00:00
parent a46e23e78e
commit dfd771c346
6 changed files with 81 additions and 42 deletions

View file

@ -93,13 +93,23 @@ public abstract class LibraryTree extends FBTree {
}
}
BookTree getBookSubTree(Book book, boolean showAuthors) {
final BookTree temp = new BookTree(Collection, book, showAuthors);
BookTree getBookSubTree(Book book) {
final BookTree temp = new BookTree(Collection, book);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (BookTree)subTrees().get(position);
} else {
return new BookTree(this, book, showAuthors, - position - 1);
return new BookTree(this, book, - position - 1);
}
}
BookTree getBookWithAuthorsSubTree(Book book) {
final BookTree temp = new BookWithAuthorsTree(Collection, book);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (BookTree)subTrees().get(position);
} else {
return new BookWithAuthorsTree(this, book, - position - 1);
}
}