|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.data.Nodes
public final class Nodes
This class stores node references of a database in an ascending order.
Instances of this class are used in the Context
class to
reference the currently used, marked, and copied nodes.
Field Summary | |
---|---|
Data |
data
Root node. |
FTPosData |
ftpos
Full-text position data (for visualization). |
int[] |
pres
Pre values container. |
boolean |
root
Root flag (nodes represent all document nodes of the database). |
int[] |
sorted
Sorted pre values. |
Constructor Summary | |
---|---|
Nodes(Data d)
Constructor, specifying a database instance. |
|
Nodes(int[] n)
Constructor, which should only used by test classes. |
|
Nodes(int[] n,
Data d)
Constructor, specifying a node set and a database instance. |
|
Nodes(int[] n,
Data d,
FTPosData ft)
Constructor, specifying a node set, a database instance, and full-text positions. |
|
Nodes(int n,
Data d)
Constructor, specifying a single node and a database instance. |
|
Nodes(Nodes nds)
Copy constructor. |
Method Summary | |
---|---|
Nodes |
checkRoot()
Checks if the node set contains all root nodes of the data instance. |
boolean |
contains(int p)
Checks if the specified node is contained in the array. |
int |
find(int p)
Returns the position of the specified node or the negative value - 1 of the position where it should have been found. |
boolean |
sameAs(Result r)
Compares results for equality. |
ArrayOutput |
serialize()
Serializes the result, using the standard serializer, and returns the cached result. |
void |
serialize(Serializer ser)
Serializes the complete result. |
void |
serialize(Serializer ser,
int n)
Serializes the specified result. |
long |
size()
Number of values, stored in the result instance. |
void |
toggle(int p)
Adds or removes the specified pre node. |
java.lang.String |
toString()
|
void |
union(int[] p)
Merges the specified array with the existing pre nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final FTPosData ftpos
public boolean root
public Data data
public int[] pres
public int[] sorted
Constructor Detail |
---|
public Nodes(Data d)
d
- data referencepublic Nodes(int n, Data d)
n
- single noded
- data referencepublic Nodes(int[] n, Data d)
n
- node setd
- data referencepublic Nodes(int[] n, Data d, FTPosData ft)
n
- node setd
- data referenceft
- ft position datapublic Nodes(int[] n)
n
- node setpublic Nodes(Nodes nds)
nds
- nodes to copyMethod Detail |
---|
public long size()
Result
size
in interface Result
public boolean sameAs(Result r)
Result
sameAs
in interface Result
r
- result to be compared
public Nodes checkRoot()
null
.
public boolean contains(int p)
p
- pre value
public int find(int p)
p
- pre value
public void toggle(int p)
p
- pre valuepublic void union(int[] p)
p
- pre valuepublic void serialize(Serializer ser) throws java.io.IOException
Result
serialize
in interface Result
ser
- serializer
java.io.IOException
- I/O exceptionpublic void serialize(Serializer ser, int n) throws java.io.IOException
Result
serialize
in interface Result
ser
- serializern
- offset of result to serialize
java.io.IOException
- I/O exceptionpublic ArrayOutput serialize() throws java.io.IOException
Result
serialize
in interface Result
java.io.IOException
- I/O exceptionpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |