Constructor and Description |
---|
ValueBuilder()
Constructor.
|
ValueBuilder(int capacity)
Constructor.
|
ValueBuilder(Item[] items,
int size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
ValueBuilder |
add(Item item)
Adds a single item.
|
ValueBuilder |
add(Value value)
Adds the contents of a value.
|
void |
addFlattened(Item it)
Adds flattened arrays.
|
Item |
get(long i)
Returns the specified item, or an arbitrary item if the index is invalid.
|
Item[] |
items()
Returns the internal item container.
|
Item |
next()
Returns the next item or
null if no other items are found. |
String |
serialize()
Serializes the result, using the standard serializer.
|
void |
serialize(Serializer ser)
Serializes the result.
|
void |
serialize(Serializer ser,
int n)
Serializes the item with the specified index.
|
void |
set(int i,
Item item)
Sets an item to the specified position.
|
long |
size()
Returns the iterator size.
|
void |
size(int s)
Sets the iterator size.
|
String |
toString() |
Value |
value()
Returns the cached items as value.
|
public ValueBuilder()
public ValueBuilder(int capacity)
capacity
- initial capacitypublic ValueBuilder(Item[] items, int size)
items
- initial itemssize
- initial sizepublic ValueBuilder add(Value value)
value
- value to be addedpublic ValueBuilder add(Item item)
item
- item to be addedpublic void addFlattened(Item it)
it
- current itempublic void serialize(Serializer ser) throws IOException
Result
serialize
in interface Result
ser
- serializerIOException
- I/O exceptionpublic void serialize(Serializer ser, int n) throws IOException
Result
serialize
in interface Result
ser
- serializern
- offset of result to serializeIOException
- I/O exceptionpublic Item next()
Iter
null
if no other items are found.public void size(int s)
s
- sizepublic 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 Item[] items()
public Item get(long i)
Iter
Iter.size()
returns the correct number of results.public void set(int i, Item item)
i
- indexitem
- item to be setpublic Value value()
public String serialize() throws IOException
Result
serialize
in interface Result
IOException
- I/O exceptionCopyright © 2005–2015 BaseX Team. All rights reserved.