public interface ISimplePositionDatabase
| Modifier and Type | Method and Description |
|---|---|
void |
addBookmark(java.lang.String description)
Precondition: Current position is NOT bookmark'ed, AND current position != null (position count > 0).
|
void |
addMove(byte fromSquare,
byte toSquare,
java.lang.String positionAfterMove)
Add move and position after it (unless null).
|
void |
addPosition(java.lang.String fen)
Add position from a FEN string.
|
void |
addPositionAnnotationSymbol(int nagCode)
Add NAG symbol for current position.
|
boolean |
canGoBack() |
void |
clearAll()
Empty all of the database.
|
void |
clearAllBookmarks()
Delete all bookmarks.
|
void |
close()
Always call this when the database is not to be used anymore.
|
void |
compact()
SQLite VACUUM operation.
|
boolean |
containsMove(byte fromSquare,
byte toSquare) |
boolean |
containsPosition(java.lang.String fen) |
boolean |
containsPositionAnnotationSymbol(int nagCode) |
void |
deleteBookmark()
Precondition: Current position is bookmark'ed.
|
void |
deleteBookmark(int index)
Delete bookmark by index.
|
void |
deleteMove(int index)
Delete move.
|
int |
getBookmarkCount() |
java.lang.String |
getBookmarkDescription(int index) |
java.lang.String |
getCurrentPosition() |
int |
getDefaultMoveRating() |
java.lang.String |
getFileName() |
int |
getIndexOfMove(byte fromSquare,
byte toSquare) |
int |
getMaxMoveRating() |
void |
getMove(int index)
Read move from database.
|
int |
getMoveCount() |
byte |
getMoveFrom() |
int |
getMoveRating(int moveIndex) |
java.lang.String |
getMoveTextCommentAfter(int moveIndex) |
java.lang.String |
getMoveTextCommentBefore(int moveIndex) |
byte |
getMoveTo() |
net.sourceforge.chessshell.common.MoveValueAnnotation |
getMoveValueAnnotation(int moveIndex) |
int |
getPositionAnnotationSymbol(int nagCodeIndex) |
int |
getPositionAnnotationSymbolCount() |
long |
getPositionCount() |
java.lang.String |
getPositionTextComment() |
java.util.Properties |
getProperties() |
void |
goBackOneMove()
When we have previously selected (played) a move, or added a move,
it is possible to go back.
|
void |
goForwardByMove(int i)
Select the i'th move (0-based index).
|
boolean |
hasMoveRating(int moveIndex) |
boolean |
isClosed() |
boolean |
isCurrentPositionBookmarked() |
boolean |
isOnlyMove(int moveIndex) |
void |
promoteVariation(int fromMoveIndex,
int toMoveIndex)
Promote move.
|
void |
selectBookmark(int index)
Navigate to bookmark by index.
|
void |
selectNextBookmark()
Navigate to next bookmark.
|
void |
selectPreviousBookmark()
Navigate to previous bookmark.
|
void |
setBookmarkDescription(int index,
java.lang.String description)
Set description for i'th bookmark.
|
void |
setDefaultMoveRating(int rating)
Set default move rating value.
|
void |
setMaxMoveRating(int rating)
Set maximal move rating.
|
void |
setMoveRating(int moveIndex,
int rating)
Set move rating.
|
void |
setMoveTextCommentAfter(int moveIndex,
java.lang.String commentText)
Set move text comment 'after'.
|
void |
setMoveTextCommentBefore(int moveIndex,
java.lang.String commentText)
Set move text comment 'before'.
|
void |
setMoveValueAnnotation(int moveIndex,
net.sourceforge.chessshell.common.MoveValueAnnotation value)
Move value annotations (!,?,...) - only one per move.
|
void |
setOnlyMoveAnnotation(int moveIndex,
boolean isOnlyMove)
Update only-move annotation for move.
|
void |
setPositionTextComment(java.lang.String txt)
Set text comment on current position.
|
long getPositionCount()
void close()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionjava.lang.String getFileName()
void addPosition(java.lang.String fen)
throws net.sourceforge.chessshell.common.DatabaseException
getCurrentPosition() will return 'fen'.fen - net.sourceforge.chessshell.common.DatabaseExceptionjava.lang.String getCurrentPosition()
boolean containsPosition(java.lang.String fen)
throws net.sourceforge.chessshell.common.DatabaseException
fen - net.sourceforge.chessshell.common.DatabaseExceptionint getMoveCount()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid goBackOneMove()
canGoBack().canGoBack()java.util.Properties getProperties()
boolean containsMove(byte fromSquare,
byte toSquare)
throws net.sourceforge.chessshell.common.DatabaseException
fromSquare - toSquare - net.sourceforge.chessshell.common.DatabaseExceptionint getIndexOfMove(byte fromSquare,
byte toSquare)
throws net.sourceforge.chessshell.common.DatabaseException
fromSquare - toSquare - net.sourceforge.chessshell.common.DatabaseExceptionboolean canGoBack()
goBackOneMove()boolean isClosed()
void addMove(byte fromSquare,
byte toSquare,
java.lang.String positionAfterMove)
throws net.sourceforge.chessshell.common.DatabaseException
fromSquare - toSquare - positionAfterMove - net.sourceforge.chessshell.common.DatabaseExceptionvoid goForwardByMove(int i)
throws net.sourceforge.chessshell.common.DatabaseException
i - net.sourceforge.chessshell.common.DatabaseExceptionint getBookmarkCount()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionboolean isCurrentPositionBookmarked()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid selectBookmark(int index)
throws net.sourceforge.chessshell.common.DatabaseException
index - net.sourceforge.chessshell.common.DatabaseExceptionvoid selectNextBookmark()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid selectPreviousBookmark()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid deleteBookmark(int index)
throws net.sourceforge.chessshell.common.DatabaseException
index - net.sourceforge.chessshell.common.DatabaseExceptionvoid clearAllBookmarks()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid compact()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid deleteBookmark()
throws net.sourceforge.chessshell.common.DatabaseException
isCurrentPositionBookmarked() first, and ONLY call this if it returns TRUE.
The bookmark collection may be corrupted otherwise.net.sourceforge.chessshell.common.DatabaseExceptionvoid addBookmark(java.lang.String description)
throws net.sourceforge.chessshell.common.DatabaseException
isCurrentPositionBookmarked() first, and ONLY call this if it returns FALSE - AND if
getPositionCount() > 0.
The bookmark collection may be corrupted otherwise.net.sourceforge.chessshell.common.DatabaseExceptionvoid setBookmarkDescription(int index,
java.lang.String description)
throws net.sourceforge.chessshell.common.DatabaseException
index - description - net.sourceforge.chessshell.common.DatabaseExceptionjava.lang.String getBookmarkDescription(int index)
throws net.sourceforge.chessshell.common.DatabaseException
index - net.sourceforge.chessshell.common.DatabaseExceptionvoid setPositionTextComment(java.lang.String txt)
throws net.sourceforge.chessshell.common.DatabaseException
txt - net.sourceforge.chessshell.common.DatabaseExceptionjava.lang.String getPositionTextComment()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid setMoveTextCommentAfter(int moveIndex,
java.lang.String commentText)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - - 0-basedcommentText - net.sourceforge.chessshell.common.DatabaseExceptionvoid setMoveTextCommentBefore(int moveIndex,
java.lang.String commentText)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - commentText - net.sourceforge.chessshell.common.DatabaseExceptionjava.lang.String getMoveTextCommentAfter(int moveIndex)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - net.sourceforge.chessshell.common.DatabaseExceptionjava.lang.String getMoveTextCommentBefore(int moveIndex)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - net.sourceforge.chessshell.common.DatabaseExceptionvoid deleteMove(int index)
throws net.sourceforge.chessshell.common.DatabaseException
index - net.sourceforge.chessshell.common.DatabaseExceptionvoid getMove(int index)
throws net.sourceforge.chessshell.common.DatabaseException
getMoveFrom() and getMoveTo() to get from/to squares.index - net.sourceforge.chessshell.common.DatabaseExceptionbyte getMoveFrom()
getMove(int)byte getMoveTo()
getMove(int)void setMoveValueAnnotation(int moveIndex,
net.sourceforge.chessshell.common.MoveValueAnnotation value)
throws net.sourceforge.chessshell.common.DatabaseException
value - net.sourceforge.chessshell.common.DatabaseExceptiongetMoveValueAnnotation(int)net.sourceforge.chessshell.common.MoveValueAnnotation getMoveValueAnnotation(int moveIndex)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - net.sourceforge.chessshell.common.DatabaseExceptionsetMoveValueAnnotation(int, MoveValueAnnotation)void setOnlyMoveAnnotation(int moveIndex,
boolean isOnlyMove)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - isOnlyMove - net.sourceforge.chessshell.common.DatabaseExceptionisOnlyMove(int)boolean isOnlyMove(int moveIndex)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - net.sourceforge.chessshell.common.DatabaseExceptionsetOnlyMoveAnnotation(int, boolean)void setMaxMoveRating(int rating)
throws net.sourceforge.chessshell.common.DatabaseException
rating - net.sourceforge.chessshell.common.DatabaseExceptionint getMaxMoveRating()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid setDefaultMoveRating(int rating)
throws net.sourceforge.chessshell.common.DatabaseException
rating - net.sourceforge.chessshell.common.DatabaseExceptionint getDefaultMoveRating()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid setMoveRating(int moveIndex,
int rating)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - rating - net.sourceforge.chessshell.common.DatabaseExceptionboolean hasMoveRating(int moveIndex)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - net.sourceforge.chessshell.common.DatabaseExceptionint getMoveRating(int moveIndex)
throws net.sourceforge.chessshell.common.DatabaseException
moveIndex - net.sourceforge.chessshell.common.DatabaseExceptionvoid addPositionAnnotationSymbol(int nagCode)
throws net.sourceforge.chessshell.common.DatabaseException
nagCode - net.sourceforge.chessshell.common.DatabaseExceptionboolean containsPositionAnnotationSymbol(int nagCode)
throws net.sourceforge.chessshell.common.DatabaseException
nagCode - net.sourceforge.chessshell.common.DatabaseExceptionint getPositionAnnotationSymbolCount()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionint getPositionAnnotationSymbol(int nagCodeIndex)
throws net.sourceforge.chessshell.common.DatabaseException
nagCodeIndex - net.sourceforge.chessshell.common.DatabaseExceptionvoid clearAll()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionvoid promoteVariation(int fromMoveIndex,
int toMoveIndex)
throws net.sourceforge.chessshell.common.DatabaseException
fromMoveIndex - toMoveIndex - net.sourceforge.chessshell.common.DatabaseException