public final class MetaData extends Object
Modifier and Type | Field and Description |
---|---|
boolean |
attrindex
Indicates if an attribute index exists.
|
boolean |
autoopt
Flag for automatic index updating.
|
boolean |
casesens
Flag for full-text case sensitivity.
|
boolean |
chop
Flag for whitespace chopping.
|
boolean |
corrupt
Indicate if the database may be corrupt.
|
boolean |
createattr
Indicates if attribute index is to be recreated.
|
boolean |
createftxt
Indicates if full-text index is to be recreated.
|
boolean |
createtext
Indicates if text index is to be recreated.
|
boolean |
diacritics
Flag for full-text diacritics removal.
|
boolean |
dirty
Dirty flag.
|
String |
encoding
Encoding of original document.
|
long |
filesize
Size of original document.
|
boolean |
ftxtindex
Indicates if a full-text index exists.
|
Language |
language
Language of full-text search index.
|
int |
lastid
Last (highest) id assigned to a node.
|
int |
maxcats
Maximum number of categories.
|
int |
maxlen
Maximum token length.
|
String |
name
Database name.
|
int |
ndocs
Number of stored documents.
|
String |
original
Path to original document.
|
IOFile |
path
Database path.
|
int |
size
Number of nodes.
|
boolean |
stemming
Flag for full-text stemming.
|
String |
stopwords
Full-text stopword file.
|
boolean |
textindex
Indicates if a text index exists.
|
long |
time
Timestamp of original document.
|
boolean |
updindex
Flag for activated automatic index update.
|
boolean |
uptodate
Indicates if index structures are out-dated.
|
Constructor and Description |
---|
MetaData(String name,
MainOptions options,
StaticOptions sopts)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
assign(Parser parser)
Assigns parser information.
|
IOFile |
binaries()
Returns the binary directory.
|
IOFile |
binary(String pth)
Returns the specified binary file or
null if the resource
path cannot be resolved (e.g. if it points to a parent directory). |
IOFile |
dbfile(String filename)
Returns a file instance for the specified database file.
|
long |
dbsize()
Returns the disk size of the database.
|
long |
dbtime()
Returns the disk timestamp of the database.
|
boolean |
drop(String pattern)
Drops the specified database files.
|
static IOFile |
file(IOFile path,
String name)
Creates a database file.
|
static String |
normPath(String path)
Normalizes a database path.
|
boolean |
oldindex()
Returns true if the indexes need to be updated.
|
void |
read()
Reads in all meta data.
|
void |
update()
Notifies the meta structures of an update and invalidates the indexes.
|
IOFile |
updateFile()
Returns a file that indicates ongoing updates.
|
public final IOFile path
null
if database is in main memory.public volatile String name
public volatile String encoding
public volatile String original
public volatile long filesize
public volatile long time
public volatile int ndocs
public volatile boolean chop
public volatile boolean updindex
public volatile boolean autoopt
public volatile boolean textindex
public volatile boolean attrindex
public volatile boolean ftxtindex
public volatile boolean createtext
public volatile boolean createattr
public volatile boolean createftxt
public volatile boolean stemming
public volatile boolean casesens
public volatile boolean diacritics
public volatile String stopwords
public volatile int maxcats
public volatile int maxlen
public volatile Language language
public volatile boolean uptodate
public volatile boolean corrupt
public volatile boolean dirty
public volatile int size
public volatile int lastid
public MetaData(String name, MainOptions options, StaticOptions sopts)
name
- name of the databaseoptions
- database optionssopts
- static optionspublic static String normPath(String path)
null
if the path contains invalid characters.path
- input pathnull
public static IOFile file(IOFile path, String name)
path
- database pathname
- filenamepublic boolean oldindex()
public long dbsize()
public long dbtime()
public IOFile dbfile(String filename)
filename
- filenamepublic IOFile binaries()
public IOFile updateFile()
public IOFile binary(String pth)
null
if the resource
path cannot be resolved (e.g. if it points to a parent directory).pth
- internal file pathpublic boolean drop(String pattern)
pattern
- file pattern or null
if all files are to be deletedpublic void read() throws IOException
IOException
- exceptionpublic void update()
public void assign(Parser parser)
parser
- parserCopyright © 2005–2015 BaseX Team. All rights reserved.