public final class Nodes extends java.lang.Object implements Result
Context class to
reference the currently used, marked, and copied nodes.| Modifier and Type | Field and Description |
|---|---|
Data |
data
Root node.
|
FTPosData |
ftpos
Full-text position data (for visualization).
|
int[] |
list
Pre values container.
|
boolean |
root
Root flag (nodes represent all document nodes of the database).
|
int[] |
sorted
Sorted pre values.
|
| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
Nodes |
checkRoot()
Checks if the node set contains all root nodes of the data instance,
and sets the
root flag. |
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.
|
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.
|
public final FTPosData ftpos
public boolean root
public Data data
public int[] list
public int[] sorted
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 long size()
Resultpublic boolean sameAs(Result r)
Resultpublic Nodes checkRoot()
root flag.public boolean contains(int p)
p - pre valuepublic int find(int p)
p - pre valuepublic void toggle(int p)
p - pre valuepublic void union(int[] p)
p - pre valuepublic void serialize(Serializer ser) throws java.io.IOException
Resultpublic void serialize(Serializer ser, int n) throws java.io.IOException
Resultpublic java.lang.String toString()
toString in class java.lang.Object