|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.query.iter.Iter
org.basex.query.iter.ValueIter
org.basex.query.iter.ValueBuilder
public final class ValueBuilder
This class can be used to build new sequences. At the same time, it serves as an iterator.
Field Summary | |
---|---|
Item[] |
item
Item container. |
Constructor Summary | |
---|---|
ValueBuilder()
Constructor. |
|
ValueBuilder(int c)
Constructor. |
|
ValueBuilder(Item[] arr,
int s)
Constructor. |
Method Summary | |
---|---|
ValueBuilder |
add(Item it)
Adds a single item. |
ValueBuilder |
add(Value val)
Adds the contents of a value. |
Item |
get(long i)
Returns the specified item, or an arbitrary item if the index is invalid. |
Item |
next()
Returns the next item or null if no other items are found. |
boolean |
reset()
Resets the iterator and returns true if operation was successful. |
boolean |
sameAs(Result v)
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. |
void |
set(Item i,
int p)
Sets an item to the specified position. |
long |
size()
Returns the iterator size. |
void |
size(int s)
Sets the iterator size. |
java.lang.String |
toString()
|
Value |
value()
Returns a sequence with all iterator values. |
Methods inherited from class org.basex.query.iter.ValueIter |
---|
iterator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Item[] item
Constructor Detail |
---|
public ValueBuilder()
public ValueBuilder(int c)
c
- initial capacitypublic ValueBuilder(Item[] arr, int s)
arr
- initial arrays
- initial sizeMethod Detail |
---|
public ValueBuilder add(Value val)
val
- value to be added
public ValueBuilder add(Item it)
it
- item to be added
public boolean sameAs(Result v)
Result
sameAs
in interface Result
v
- result to be compared
public 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 Item next()
Iter
null
if no other items are found.
next
in class ValueIter
null
public void size(int s)
s
- sizepublic boolean reset()
Iter
true
if operation was successful.
false
is returned if the iterator cannot be reset.
reset
in class ValueIter
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.
size
in interface Result
size
in class ValueIter
public Item get(long i)
Iter
Iter.size()
returns the correct number of results. A calling method
should call Iter.reset()
after the last items has been retrieved.
get
in class ValueIter
i
- value offset
public void set(Item i, int p)
i
- item to be setp
- positionpublic Value value()
Iter
Iter.next()
has not been called before.
value
in class ValueIter
public 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 |