|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.unipi.di.rs.Select
public class Select
An index implementing the select
function over binary files.
The index uses a two-level-bucketing system to store information about partial counts. It
performs the select
operations in constant time and the rank
through a binary search.
Field Summary |
---|
Fields inherited from interface it.unipi.di.rs.IRankSelect |
---|
DISK, MEMORY |
Constructor Summary | |
---|---|
Select(String source)
Creates an object and initializes basic data structures; it will be necessary to use a specific method to create data structures or load them. |
|
Select(String source,
Directory tdb)
Creates an object from a source contained in a Directory and initializes basic data structures; it will be necessary to use a specific method to create data structures or load them. |
Method Summary | |
---|---|
long |
count1(long start,
long end)
Returns the number of 1s in the selected range of the source |
void |
createIndex(int mode)
Creates the index in memory or on disk. |
void |
createIndex(int mode,
float iPerc)
Creates the index in memory or on disk using the specified amount of space |
void |
createIndex(int mode,
int lbLen,
int sbLen)
Creates index data structures using specified lengths |
boolean |
get(long index)
Returns the value at the specified position |
static String |
getIndexFileName(String baseName)
Generates the names of the file that will contain the index in case of store() operations |
long |
ISize()
Returns the size in bits of the index |
void |
load()
Loads the data structures from the default file(s) |
void |
load(Directory directory)
This methods acts as IRankSelect.load() , but load data structures from a Directory |
int |
numLBSelect()
Returns the number of Large buckets |
long |
rank0(long pos)
Returns the rank0 at the pos-th bit (starting from 0) |
long |
rank1(long pos)
Returns the rank1 at the pos-th bit (starting from 0) |
long |
Scard()
Returns the number of 1s in the source |
long |
select1(long rank)
Returns the position of the rank-th 1 (starting from 0) |
int |
sizeLBSelect()
Returns the number of 1s in the Large buckets |
int |
sizeSBSelect()
Returns the number of 1s in the Small buckets |
long |
Ssize()
Returns the size in bits of the source file. |
void |
store()
Stores data structures in the default file(s). |
void |
store(Directory directory)
This methods acts as IRankSelect.store() , but store data structures inside a Directory |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Select(String source) throws IOException
source
- the name of the source file
IOException
public Select(String source, Directory tdb) throws IOException
source
- the name of the source file inside the Directorytdb
- the Directory
that contains the source
IOException
Method Detail |
---|
public static String getIndexFileName(String baseName)
store()
operations
baseName
- is the name from which generate the new names; tipically the name of the source of the index
public int sizeLBSelect() throws IOException
IOException
public int sizeSBSelect() throws IOException
IOException
public int numLBSelect() throws IOException
IOException
public long Scard() throws IOException
IRankSelect
Scard
in interface IRankSelect
IOException
public long Ssize()
IRankSelect
Ssize
in interface IRankSelect
public long ISize() throws IOException
IRankSelect
ISize
in interface IRankSelect
IOException
public void createIndex(int mode) throws IOException
IRankSelect
createIndex
in interface IRankSelect
mode
- the mode of creation (IRankSelect.MEMORY
or IRankSelect.DISK
)
IOException
public void createIndex(int mode, float iPerc) throws IOException
IRankSelect
createIndex
in interface IRankSelect
mode
- the mode of creation (IRankSelect.MEMORY
or IRankSelect.DISK
)iPerc
- is the space occupancy in terms of % of the source dimension that the index must achieve
IOException
public void createIndex(int mode, int lbLen, int sbLen) throws IOException
mode
- the mode of creationlbLen
- #1 in first-level bucketssbLen
- #1 in second-level buckets
YQLException
IOException
public long rank0(long pos) throws IOException
IRankSelect
rank0
in interface IRankSelect
pos
- is the position to analyze
IOException
public long rank1(long pos) throws IOException
IRankSelect
rank1
in interface IRankSelect
pos
- is the position to analyze
IOException
public long select1(long rank) throws IOException
IRankSelect
select1
in interface IRankSelect
rank
- is the rank to find
IOException
public void load() throws IOException
IRankSelect
load
in interface IRankSelect
IOException
public void load(Directory directory) throws IOException
IRankSelect
IRankSelect.load()
, but load data structures from a Directory
load
in interface IRankSelect
directory
- the source Directory; must be opened in READ_MODE
IOException
public void store() throws IOException
IRankSelect
store
in interface IRankSelect
IOException
public void store(Directory directory) throws IOException
IRankSelect
IRankSelect.store()
, but store data structures inside a Directory
store
in interface IRankSelect
directory
- the destination Directory; must be opened in WRITE_MODE
IOException
public long count1(long start, long end) throws IOException
IRankSelect
count1
in interface IRankSelect
IOException
public boolean get(long index) throws IOException
IRankSelect
get
in interface IRankSelect
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |