Package org.basex.index.value
Class MemValues
java.lang.Object
org.basex.index.value.ValueIndex
org.basex.index.value.MemValues
- All Implemented Interfaces:
Index
This class provides main memory access to attribute values and text contents.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
Fields inherited from class org.basex.index.value.ValueIndex
data, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ValueCache cache) Add entries to the index.voidclose()Closes the index.costs(IndexSearch search) Computes costs for performing the specified search.voiddelete(ValueCache cache) Deletes entries from the index.booleandrop()Drops the index.entries(IndexEntries entries) Returns all entries that match the specified token.voidflush()Flushes the buffered data.byte[]info(MainOptions options) Returns information on the index structure.iter(IndexSearch search) Returns an iterator for the index results.intsize()Returns the number of index entries.toString()toString(boolean all) Returns a string representation of the index structure.
-
Constructor Details
-
MemValues
Constructor.- Parameters:
data- data instancetype- index type
-
-
Method Details
-
iter
Description copied from interface:IndexReturns an iterator for the index results.- Parameters:
search- index search definition- Returns:
- sorted pre values for the token
-
costs
Description copied from interface:IndexComputes costs for performing the specified search. An integer is returned:- A negative value indicates that index access is not possible.
- A value of zero indicates that no results will be returned.
- A small value indicates that index access is fast.
- Parameters:
search- index search definition- Returns:
- cost estimation
-
entries
Description copied from interface:IndexReturns all entries that match the specified token.- Parameters:
entries- index entries- Returns:
- entries
-
info
Description copied from interface:IndexReturns information on the index structure.- Parameters:
options- main options- Returns:
- info
-
size
public int size()Description copied from class:ValueIndexReturns the number of index entries.- Specified by:
sizein classValueIndex- Returns:
- number of index entries
-
drop
public boolean drop()Description copied from interface:IndexDrops the index. Also returns true if the index does not exist.- Returns:
- success flag
-
add
Description copied from class:ValueIndexAdd entries to the index.- Specified by:
addin classValueIndex- Parameters:
cache- value cache with [key, id-list] pairs
-
delete
Description copied from class:ValueIndexDeletes entries from the index.- Specified by:
deletein classValueIndex- Parameters:
cache- value cache with [key, id-list] pairs
-
flush
public void flush()Description copied from class:ValueIndexFlushes the buffered data.- Specified by:
flushin classValueIndex
-
close
public void close()Description copied from interface:IndexCloses the index. -
toString
Returns a string representation of the index structure.- Parameters:
all- include database contents in the representation. During updates, database lookups must be avoided, as the data structures will be inconsistent- Returns:
- string
-
toString
-