public class FolderManagerSqlite4Java
extends java.lang.Object
implements net.sourceforge.chessshell.plugin.api.IFolderManager
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
FolderManagerSqlite4Java.FolderInfo |
| Modifier and Type | Field and Description |
|---|---|
private com.almworks.sqlite4java.SQLiteConnection |
itsConnection |
private long |
itsFolderId |
private java.util.List<DatabaseFolder> |
itsFolderList |
private net.sourceforge.chessshell.plugin.api.FolderPath |
itsFolderPath |
private java.util.List<DatabaseFolderItem> |
itsItemList |
private java.util.Stack<java.lang.Long> |
visitedFolder |
| Constructor and Description |
|---|
FolderManagerSqlite4Java(java.lang.String fileName)
Create manager based on the file.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addNewFolder(java.lang.String name) |
void |
addNewItem(net.sourceforge.chessshell.plugin.api.FolderItem item) |
private void |
addRootFolder() |
void |
close() |
private void |
createCurrentFolder() |
private void |
deleteCurrentFolder() |
void |
deleteFolder(int i) |
void |
deleteItem(int itemIndex) |
void |
deleteItemByContentIndex(long contentIndex) |
private byte[] |
getBytesFromObject(java.lang.Object obj) |
private long |
getCurrentFolderId() |
net.sourceforge.chessshell.plugin.api.FolderPath |
getCurrentPath() |
int |
getFolderCount() |
private int |
getFolderIdByParentAndName(long parentFolderId,
java.lang.String name) |
private FolderManagerSqlite4Java.FolderInfo |
getFolderInfoById(long folderId) |
java.lang.String |
getFolderName(int i) |
private java.util.Stack<java.lang.String> |
getFolderNameStack(long folderId) |
net.sourceforge.chessshell.plugin.api.FolderItem |
getItem(int i) |
int |
getItemCount() |
private long |
getMaxFolderId() |
private long |
getMaxItemId() |
boolean |
hasParentFolder() |
private void |
insertCurrentFolder() |
private java.lang.Object |
makeObject(byte[] yourBytes) |
private void |
reduceContentIndexInItemListWhereLargerThan(long contentIndex) |
private void |
removeContentIndexFromItemList(long contentIndex) |
private boolean |
removeFirstContentIndexFromItemList(long contentIndex) |
void |
selectFolderByIndex(int i) |
void |
selectParentFolder() |
void |
selectRootFolder() |
private void |
updateFolderList() |
private void |
updateItemList() |
private void |
updateItsLists(long folderId) |
private com.almworks.sqlite4java.SQLiteConnection itsConnection
private final net.sourceforge.chessshell.plugin.api.FolderPath itsFolderPath
private long itsFolderId
private final java.util.List<DatabaseFolderItem> itsItemList
private final java.util.List<DatabaseFolder> itsFolderList
private final java.util.Stack<java.lang.Long> visitedFolder
FolderManagerSqlite4Java(java.lang.String fileName)
throws net.sourceforge.chessshell.common.DatabaseException
fileName - net.sourceforge.chessshell.common.DatabaseExceptionprivate java.util.Stack<java.lang.String> getFolderNameStack(long folderId)
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionprivate FolderManagerSqlite4Java.FolderInfo getFolderInfoById(long folderId) throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionprivate long getCurrentFolderId()
private void addRootFolder()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionpublic void close()
throws net.sourceforge.chessshell.common.DatabaseException
close in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionprivate void deleteCurrentFolder()
throws com.almworks.sqlite4java.SQLiteException
com.almworks.sqlite4java.SQLiteExceptionprivate void createCurrentFolder()
throws com.almworks.sqlite4java.SQLiteException
com.almworks.sqlite4java.SQLiteExceptionprivate void insertCurrentFolder()
throws com.almworks.sqlite4java.SQLiteException
com.almworks.sqlite4java.SQLiteExceptionpublic net.sourceforge.chessshell.plugin.api.FolderPath getCurrentPath()
getCurrentPath in interface net.sourceforge.chessshell.plugin.api.IFolderManagerpublic boolean addNewFolder(java.lang.String name)
throws net.sourceforge.chessshell.common.DatabaseException
addNewFolder in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic void addNewItem(net.sourceforge.chessshell.plugin.api.FolderItem item)
throws net.sourceforge.chessshell.common.DatabaseException
addNewItem in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionprivate byte[] getBytesFromObject(java.lang.Object obj)
throws java.io.IOException
java.io.IOExceptionprivate long getMaxItemId()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionprivate long getMaxFolderId()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionpublic int getFolderCount()
throws net.sourceforge.chessshell.common.DatabaseException
getFolderCount in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic java.lang.String getFolderName(int i)
throws net.sourceforge.chessshell.common.DatabaseException
getFolderName in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic int getItemCount()
throws net.sourceforge.chessshell.common.DatabaseException
getItemCount in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic net.sourceforge.chessshell.plugin.api.FolderItem getItem(int i)
throws net.sourceforge.chessshell.common.DatabaseException
getItem in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic void deleteItem(int itemIndex)
throws net.sourceforge.chessshell.common.DatabaseException
deleteItem in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic void deleteItemByContentIndex(long contentIndex)
throws net.sourceforge.chessshell.common.DatabaseException
deleteItemByContentIndex in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionprivate void reduceContentIndexInItemListWhereLargerThan(long contentIndex)
private void removeContentIndexFromItemList(long contentIndex)
private boolean removeFirstContentIndexFromItemList(long contentIndex)
public void selectFolderByIndex(int i)
throws net.sourceforge.chessshell.common.DatabaseException
selectFolderByIndex in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionprivate void updateItsLists(long folderId)
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionprivate void updateFolderList()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionprivate void updateItemList()
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseExceptionprivate java.lang.Object makeObject(byte[] yourBytes)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic boolean hasParentFolder()
hasParentFolder in interface net.sourceforge.chessshell.plugin.api.IFolderManagerpublic void selectParentFolder()
throws net.sourceforge.chessshell.common.DatabaseException
selectParentFolder in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic void selectRootFolder()
throws net.sourceforge.chessshell.common.DatabaseException
selectRootFolder in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionpublic void deleteFolder(int i)
throws net.sourceforge.chessshell.common.DatabaseException
deleteFolder in interface net.sourceforge.chessshell.plugin.api.IFolderManagernet.sourceforge.chessshell.common.DatabaseExceptionprivate int getFolderIdByParentAndName(long parentFolderId,
java.lang.String name)
throws net.sourceforge.chessshell.common.DatabaseException
net.sourceforge.chessshell.common.DatabaseException