| Constructor and Description |
|---|
NodeCache()
Constructor.
|
NodeCache(ANode[] it,
int s)
Constructor, specifying an initial array of sorted nodes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ANode n)
Adds a node.
|
int |
binarySearch(DBNode nd,
int start,
int length)
|
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 node,
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. |
NodeCache |
random()
Sets the internal duplicate flag, which indicates that duplicate and
unordered nodes might be added to this iterator.
|
boolean |
reset()
Resets the iterator and returns
true if operation was successful. |
long |
size()
Returns the iterator size.
|
void |
size(int s)
Sets a new item size.
|
NodeCache |
sort()
Sorts the nodes, if necessary.
|
java.lang.String |
toString() |
Value |
value()
Returns a sequence with all iterator values.
|
public ANode[] item
public NodeCache()
public NodeCache(ANode[] it, int s)
it - node arrays - sizepublic NodeCache random()
public ANode get(int i)
i - node offsetpublic void delete(int p)
p - deletion positionpublic void add(ANode n)
n - node to be addedpublic boolean reset()
Itertrue if operation was successful.
false is returned if the iterator cannot be reset.public ANode next()
Iternull if no other items are found.public ANode get(long i)
IterIter.size() returns the correct number of results. A calling method
should call Iter.reset() after the last items has been retrieved.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()
IterIter.next() has not been called before.public boolean dbnodes()
DBNode references and refer to the same database.public int indexOf(ANode node, boolean db)
node - node to be founddb - indicates if all nodes are sorted DBNode references-1public int binarySearch(DBNode nd, int start, int length)
DBNodes from the same Data
instance (i.e., dbnodes() returns true).nd - node to findstart - start of the search intervallength - length of the search interval-insertPosition - 1 if not foundpublic NodeCache sort()
public java.lang.String toString()
toString in class java.lang.Object