Constructor and Description |
---|
NodeSeqBuilder()
Constructor.
|
NodeSeqBuilder(ANode[] nodes,
int size)
Lightweight constructor, assigning the specified array of sorted nodes.
|
Modifier and Type | Method and Description |
---|---|
void |
add(ANode n)
Adds a node.
|
int |
binarySearch(DBNode n,
int start,
int length)
|
NodeSeqBuilder |
check()
Checks all nodes for potential duplicates and their orderedness.
|
boolean |
dbnodes()
Checks if binary search can be applied to this iterator, i.e.
|
void |
delete(int p)
Deletes a value at the specified position.
|
ANode |
get(int i)
Returns the specified node.
|
ANode |
get(long i)
Returns the specified item, or an arbitrary item if the index is invalid.
|
int |
indexOf(ANode n,
boolean db)
Checks if the iterator contains a database node with the specified pre value.
|
ANode |
next()
Returns the next item or
null if no other items are found. |
long |
size()
Returns the iterator size.
|
void |
size(int s)
Sets a new item size.
|
NodeSeqBuilder |
sort()
Sorts the nodes if necessary.
|
String |
toString() |
Value |
value()
Returns a value with all iterated items.
|
public ANode[] nodes
public NodeSeqBuilder()
public NodeSeqBuilder(ANode[] nodes, int size)
nodes
- node arraysize
- sizepublic NodeSeqBuilder check()
public ANode get(int i)
i
- node offsetpublic void delete(int p)
p
- deletion positionpublic void add(ANode n)
n
- node to be addedpublic ANode next()
Iter
null
if no other items are found.public ANode get(long i)
Iter
Iter.size()
returns the correct number of results.public long size()
Iter
-1
is returned if the
result size is unknown. If this method is implemented by an iterator,
Iter.get(long)
needs to be implemented as well.public void size(int s)
s
- sizepublic Value value()
Iter
Iter.next()
has not been called before.public boolean dbnodes()
DBNode
references and refer to the same database.public int indexOf(ANode n, boolean db)
n
- node to be founddb
- indicates if all nodes are sorted DBNode
references-1
public int binarySearch(DBNode n, int start, int length)
DBNode
s from the same Data
instance (i.e., dbnodes()
returns true
).n
- node to findstart
- start of the search intervallength
- length of the search interval-insertPosition - 1
if not foundpublic NodeSeqBuilder sort()
Copyright © 2005–2015 BaseX Team. All rights reserved.