| Modifier and Type | Field and Description |
|---|---|
private File |
backendDir |
private Map<String,Document> |
documents |
private String |
name |
UNIQUE_NAME_KEY| Constructor and Description |
|---|
DatabaseImpl(String name,
Map<String,Document> documents,
File backendDir) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the currently loaded documents.
|
boolean |
contains(Document document) |
boolean |
contains(String name) |
boolean |
containsDoc(String name) |
Database |
delete(Document document) |
Database |
delete(String name) |
Database |
deleteAsync(String name) |
File |
getBackendDir() |
Collection<Document> |
getDocs() |
Document |
getDocument(String name) |
FutureTask<Document> |
getDocumentAsync(String name) |
Map<String,Document> |
getDocuments() |
String |
getName() |
Database |
insert(Document... documents) |
Database |
insertAsync(Document... documents) |
Document |
load(String name) |
Database |
loadDocuments() |
void |
save()
Saves the currently loaded documents to their files.
|
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateEmptyDocumentpublic String getName()
public File getBackendDir()
public Database loadDocuments()
loadDocuments in interface Databasepublic Collection<Document> getDocs()
public Document getDocument(String name)
getDocument in interface Databasepublic boolean containsDoc(String name)
containsDoc in interface Databasepublic Database insertAsync(Document... documents)
insertAsync in interface Databasepublic Database deleteAsync(String name)
deleteAsync in interface Databasepublic FutureTask<Document> getDocumentAsync(String name)
getDocumentAsync in interface Databasepublic void save()
public void clear()
Copyright © 2020. All rights reserved.