org.basex.index
Class MemValues

java.lang.Object
  extended by org.basex.util.Set
      extended by org.basex.index.MemValues
All Implemented Interfaces:
Index

public final class MemValues
extends Set
implements Index

This class provides a main-memory access to attribute values and text contents.

Author:
Workgroup DBIS, University of Konstanz 2005-07, ISC License, Christian Gruen

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.basex.index.Index
Index.TYPE
 
Field Summary
 
Fields inherited from class org.basex.util.Set
size
 
Constructor Summary
MemValues()
           
 
Method Summary
 void close()
          Close the index.
 int get(byte[] key)
          Returns the id for the specified key.
 int[][] idPos(byte[] tok, FTOption ftO)
          Returns all ids from index stored for tok with respect to ftO.
 int[] ids(byte[] key)
          Returns the value for the specified key.
 int[] ids(byte[] tok, FTOption ftO)
          Returns all ids from index stored for tok with respect to ftO.
 int index(byte[] key, int id)
          Indexes the specified keys and values.
 void info(PrintOutput out)
          Returns information on the index structure.
 int nrIDs(byte[] key)
          Returns the value for the specified key.
 byte[] token(int id)
          Returns the token for the specified id.
 
Methods inherited from class org.basex.util.Set
add, id, key, keys, size
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemValues

public MemValues()
Method Detail

close

public void close()
Close the index.

Specified by:
close in interface Index

get

public int get(byte[] key)
Returns the id for the specified key.

Parameters:
key - key
Returns:
id (negative if value wasn't found)

idPos

public int[][] idPos(byte[] tok,
                     FTOption ftO)
Returns all ids from index stored for tok with respect to ftO.

Specified by:
idPos in interface Index
Parameters:
tok - token to be found
ftO - FTOption for tok
Returns:
number of ids

ids

public int[] ids(byte[] key)
Returns the value for the specified key.

Specified by:
ids in interface Index
Parameters:
key - key to be found
Returns:
value or null if nothing was found

ids

public int[] ids(byte[] tok,
                 FTOption ftO)
Returns all ids from index stored for tok with respect to ftO.

Specified by:
ids in interface Index
Parameters:
tok - token to be found
ftO - FTOption for tok
Returns:
number of ids

index

public int index(byte[] key,
                 int id)
Indexes the specified keys and values.

Parameters:
key - key
id - id value
Returns:
index position

info

public void info(PrintOutput out)
          throws java.io.IOException
Returns information on the index structure.

Specified by:
info in interface Index
Parameters:
out - output stream
Throws:
java.io.IOException - in case of write errors

nrIDs

public int nrIDs(byte[] key)
Returns the value for the specified key.

Specified by:
nrIDs in interface Index
Parameters:
key - key to be found
Returns:
value or null if nothing was found

token

public byte[] token(int id)
Returns the token for the specified id.

Parameters:
id - id
Returns:
token