本文整理汇总了Java中org.geometerplus.fbreader.book.Bookmark.getEnd方法的典型用法代码示例。如果您正苦于以下问题:Java Bookmark.getEnd方法的具体用法?Java Bookmark.getEnd怎么用?Java Bookmark.getEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.geometerplus.fbreader.book.Bookmark
的用法示例。
在下文中一共展示了Bookmark.getEnd方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setBookmarkHighlightings
import org.geometerplus.fbreader.book.Bookmark; //导入方法依赖的package包/类
private void setBookmarkHighlightings(ZLTextView view, String modelId)
{
view.removeHighlightings(BookmarkHighlighting.class);
for (BookmarkQuery query = new BookmarkQuery(Model.Book, 20);; query = query.next())
{
final List<Bookmark> bookmarks = Collection.bookmarks(query);
if (bookmarks.isEmpty())
{
break;
}
for (Bookmark b : bookmarks)
{
if (b.getEnd() == null)
{
b.findEnd(view);
}
if (MiscUtil.equals(modelId, b.ModelId))
{
view.addHighlighting(new BookmarkHighlighting(view, Collection, b));
}
}
}
}
示例2: setBookmarkHighlightings
import org.geometerplus.fbreader.book.Bookmark; //导入方法依赖的package包/类
private void setBookmarkHighlightings(ZLTextView view, String modelId) {
view.removeHighlightings(BookmarkHighlighting.class);
for (BookmarkQuery query = new BookmarkQuery(Model.Book, 20); ; query = query.next()) {
final List<Bookmark> bookmarks = Collection.bookmarks(query);
if (bookmarks.isEmpty()) {
break;
}
for (Bookmark b : bookmarks) {
if (b.getEnd() == null) {
b.findEnd(view);
}
if (MiscUtil.equals(modelId, b.ModelId)) {
view.addHighlighting(new BookmarkHighlighting(view, Collection, b));
}
}
}
}
示例3: endPosition
import org.geometerplus.fbreader.book.Bookmark; //导入方法依赖的package包/类
private static ZLTextPosition endPosition(Bookmark bookmark) {
final ZLTextPosition end = bookmark.getEnd();
if (end != null) {
return end;
}
// TODO: compute end and save bookmark
return bookmark;
}
示例4: saveBookmark
import org.geometerplus.fbreader.book.Bookmark; //导入方法依赖的package包/类
@Override
protected long saveBookmark(Bookmark bookmark) {
SQLiteStatement statement;
if (bookmark.getId() == -1) {
if (myInsertBookmarkStatement == null) {
myInsertBookmarkStatement = myDatabase.compileStatement(
"INSERT OR IGNORE INTO Bookmarks (book_id,bookmark_text,creation_time,modification_time,access_time,access_counter,model_id,paragraph,word,char,end_paragraph,end_word,end_character,visible,style_id) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
);
}
statement = myInsertBookmarkStatement;
} else {
if (myUpdateBookmarkStatement == null) {
myUpdateBookmarkStatement = myDatabase.compileStatement(
"UPDATE Bookmarks SET book_id = ?, bookmark_text = ?, creation_time =?, modification_time = ?,access_time = ?, access_counter = ?, model_id = ?, paragraph = ?, word = ?, char = ?, end_paragraph = ?, end_word = ?, end_character = ?, visible = ?, style_id = ? WHERE bookmark_id = ?"
);
}
statement = myUpdateBookmarkStatement;
}
statement.bindLong(1, bookmark.getBookId());
statement.bindString(2, bookmark.getText());
SQLiteUtil.bindDate(statement, 3, bookmark.getDate(Bookmark.DateType.Creation));
SQLiteUtil.bindDate(statement, 4, bookmark.getDate(Bookmark.DateType.Modification));
SQLiteUtil.bindDate(statement, 5, bookmark.getDate(Bookmark.DateType.Access));
statement.bindLong(6, bookmark.getAccessCount());
SQLiteUtil.bindString(statement, 7, bookmark.ModelId);
statement.bindLong(8, bookmark.ParagraphIndex);
statement.bindLong(9, bookmark.ElementIndex);
statement.bindLong(10, bookmark.CharIndex);
final ZLTextPosition end = bookmark.getEnd();
if (end != null) {
statement.bindLong(11, end.getParagraphIndex());
statement.bindLong(12, end.getElementIndex());
statement.bindLong(13, end.getCharIndex());
} else {
statement.bindLong(11, bookmark.getLength());
statement.bindNull(12);
statement.bindNull(13);
}
statement.bindLong(14, bookmark.IsVisible ? 1 : 0);
statement.bindLong(15, bookmark.getStyleId());
if (statement == myInsertBookmarkStatement) {
return statement.executeInsert();
} else {
final long id = bookmark.getId();
statement.bindLong(16, id);
statement.execute();
return id;
}
}