org.basex.data
Class MemData

java.lang.Object
  extended by org.basex.data.Data
      extended by org.basex.data.MemData

public final class MemData
extends Data

This class stores and organizes the database table and the index structures for textual content in a compressed memory structure. The table mapping is documented in Data.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.basex.data.Data
Data.Type
 
Field Summary
 
Fields inherited from class org.basex.data.Data
ATTR, atts, COMM, DOC, ELEM, fs, meta, nameID, ns, path, PI, sizeID, tags, TEXT
 
Constructor Summary
MemData(Data data)
          Constructor, adopting meta data from the specified database.
MemData(Names tag, Names att, Namespaces n, PathSummary s, Prop pr)
          Constructor.
MemData(Prop pr)
          Constructor, creating a new, empty database.
 
Method Summary
 void closeIndex(Data.Type index)
          Closes the specified index.
 void cls()
          Internal method to close the database.
 void flush()
          Flushes the table data.
 void setIndex(Data.Type type, Index ind)
          Assigns the specified index.
 byte[] text(int pre, boolean text)
          Returns a text (text, comment, pi) or attribute value.
 void text(int pre, byte[] val, boolean txt)
          Updates the specified text or attribute value.
 int textLen(int pre, boolean text)
          Returns a text (text, comment, pi) length.
 double textNum(int pre, boolean text)
          Returns a text (text, comment, pi) as double value.
 
Methods inherited from class org.basex.data.Data
atom, attr, attSize, buffer, close, delete, doc, doc, elem, id, ids, info, init, insert, insert, insertAttr, kind, name, name, nrIDs, ns, nsFlag, parent, pre, rename, replace, size, size, text, toString, toString, uri
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MemData

public MemData(Names tag,
               Names att,
               Namespaces n,
               PathSummary s,
               Prop pr)
Constructor.

Parameters:
tag - tag index
att - attribute name index
n - namespaces
s - path summary
pr - database properties

MemData

public MemData(Data data)
Constructor, adopting meta data from the specified database.

Parameters:
data - data reference

MemData

public MemData(Prop pr)
Constructor, creating a new, empty database.

Parameters:
pr - property reference
Method Detail

flush

public void flush()
Description copied from class: Data
Flushes the table data.

Specified by:
flush in class Data

cls

public void cls()
Description copied from class: Data
Internal method to close the database.


closeIndex

public void closeIndex(Data.Type index)
Description copied from class: Data
Closes the specified index.

Specified by:
closeIndex in class Data
Parameters:
index - index to be closed

setIndex

public void setIndex(Data.Type type,
                     Index ind)
Description copied from class: Data
Assigns the specified index.

Specified by:
setIndex in class Data
Parameters:
type - index to be opened
ind - index instance

text

public byte[] text(int pre,
                   boolean text)
Description copied from class: Data
Returns a text (text, comment, pi) or attribute value.

Specified by:
text in class Data
Parameters:
pre - pre value
text - text/attribute flag
Returns:
atomized value

textNum

public double textNum(int pre,
                      boolean text)
Description copied from class: Data
Returns a text (text, comment, pi) as double value.

Specified by:
textNum in class Data
Parameters:
pre - pre value
text - text/attribute flag
Returns:
numeric value

textLen

public int textLen(int pre,
                   boolean text)
Description copied from class: Data
Returns a text (text, comment, pi) length.

Specified by:
textLen in class Data
Parameters:
pre - pre value
text - text/attribute flag
Returns:
length

text

public void text(int pre,
                 byte[] val,
                 boolean txt)
Description copied from class: Data
Updates the specified text or attribute value.

Parameters:
pre - pre value
val - content
txt - text (text, comment or pi) or attribute flag