mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 10:49:24 +02:00
autosorting for AuthorTree's
This commit is contained in:
parent
05365b01d1
commit
31075d08a0
3 changed files with 19 additions and 13 deletions
|
@ -56,8 +56,14 @@ public abstract class LibraryTree extends FBTree {
|
|||
return new TitleTree(this, title);
|
||||
}
|
||||
|
||||
AuthorTree createAuthorSubTree(Author author) {
|
||||
return new AuthorTree(this, author);
|
||||
AuthorTree getAuthorSubTree(Author author) {
|
||||
final AuthorTree temp = new AuthorTree(author);
|
||||
int position = Collections.binarySearch(subTrees(), temp);
|
||||
if (position >= 0) {
|
||||
return (AuthorTree)subTrees().get(position);
|
||||
} else {
|
||||
return new AuthorTree(this, author, - position - 1);
|
||||
}
|
||||
}
|
||||
|
||||
BookTree createBookSubTree(Book book, boolean showAuthors) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue