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:
parent
a46e23e78e
commit
dfd771c346
6 changed files with 81 additions and 42 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue