public abstract class ContentStore extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ContentStore.DocTask
A task to perform on a document in the content store.
|
Constructor and Description |
---|
ContentStore() |
Modifier and Type | Method and Description |
---|---|
abstract void |
clear()
Clear the entire content store.
|
abstract void |
close()
Close the content store
|
abstract void |
delete(int id)
Delete a document from the content store.
|
abstract int |
docLength(int id)
Returns the document length in characters
|
void |
forEachDocument(ContentStore.DocTask task)
Perform a task on each document in the content store.
|
abstract Set<Integer> |
idSet()
Returns the set of doc ids in the store.
|
abstract void |
initialize() |
abstract boolean |
isDeleted(int id)
Return true iff the entry with this id was deleted.
|
static ContentStore |
open(File indexXmlDir,
boolean indexMode,
boolean create) |
abstract String |
retrieve(int id)
Retrieve a document from the content store.
|
String |
retrievePart(int id,
int start,
int end)
Retrieve one or more substrings from the specified content.
|
abstract String[] |
retrieveParts(int id,
int[] start,
int[] end)
Retrieve substrings from a document.
|
abstract int |
store(String content)
Store a document.
|
abstract void |
storePart(String content)
Store part of a large document.
|
public static ContentStore open(File indexXmlDir, boolean indexMode, boolean create) throws ErrorOpeningIndex
ErrorOpeningIndex
public abstract int store(String content)
content
- (part of) the content of the document to storepublic abstract void storePart(String content)
content
- part of the content of the document to storepublic abstract String retrieve(int id)
id
- the document's content store idpublic String retrievePart(int id, int start, int end)
id
- id of the entry to get substrings fromstart
- the starting points of the substrings (in characters). -1 means
"start of document"end
- the end points of the substrings (in characters). -1 means "end of
document"public abstract String[] retrieveParts(int id, int[] start, int[] end)
id
- content store document idstart
- start of the substringend
- end of the substringpublic abstract void close()
public abstract void delete(int id)
id
- content store id of the document to deletepublic abstract void clear() throws IOException
IOException
public abstract Set<Integer> idSet()
public abstract boolean isDeleted(int id)
id
- the entry to checkpublic abstract int docLength(int id)
id
- the documentpublic void forEachDocument(ContentStore.DocTask task)
task
- the task to performpublic abstract void initialize()
Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.