org.basex.data
Class Skeleton

java.lang.Object
  extended by org.basex.data.Skeleton

public final class Skeleton
extends java.lang.Object

This class stores the tree structure of a document.

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

Nested Class Summary
static class Skeleton.Node
          Skeleton node.
 
Constructor Summary
Skeleton()
          Default Constructor.
Skeleton(Data d, DataInput in)
          Constructor, specifying an input file.
 
Method Summary
 void add(int n, int l, byte k)
          Opens an element.
 java.util.ArrayList<Skeleton.Node> desc(java.util.ArrayList<Skeleton.Node> in, int t, int k, boolean desc)
          Returns the descendant for the specified nodes.
 TokenList desc(byte[] k, boolean d, boolean o)
          Return descendant tags and attributes for the specified start key.
 TokenList desc(TokenList in, boolean d, boolean o)
          Return descendant tags and attributes for the specified descendant path.
 void finish(DataOutput out)
          Finishes the structure.
 void init()
          Initializes the data structures.
 Skeleton.Node root()
          Returns the skeleton root.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Skeleton

public Skeleton()
Default Constructor.


Skeleton

public Skeleton(Data d,
                DataInput in)
         throws java.io.IOException
Constructor, specifying an input file.

Parameters:
d - data reference
in - input stream
Throws:
java.io.IOException - I/O exception
Method Detail

init

public void init()
Initializes the data structures.


root

public Skeleton.Node root()
Returns the skeleton root.

Returns:
root

add

public void add(int n,
                int l,
                byte k)
Opens an element.

Parameters:
n - name reference
l - current level
k - node kind

finish

public void finish(DataOutput out)
            throws java.io.IOException
Finishes the structure.

Parameters:
out - output stream
Throws:
java.io.IOException - I/O exception

desc

public TokenList desc(byte[] k,
                      boolean d,
                      boolean o)
Return descendant tags and attributes for the specified start key.

Parameters:
k - input key
d - if false, return only children
o - true/false: sort by occurrence/lexicographically
Returns:
children

desc

public TokenList desc(TokenList in,
                      boolean d,
                      boolean o)
Return descendant tags and attributes for the specified descendant path.

Parameters:
in - input steps
d - if false, return only children
o - true/false: sort by occurrence/lexicographically
Returns:
children

desc

public java.util.ArrayList<Skeleton.Node> desc(java.util.ArrayList<Skeleton.Node> in,
                                               int t,
                                               int k,
                                               boolean desc)
Returns the descendant for the specified nodes.

Parameters:
in - input nodes
t - name reference
k - node kind
desc - if false, return only children
Returns:
descendant nodes