Package org.basex.query.value
Class ValueBuilder
- java.lang.Object
-
- org.basex.query.value.ValueBuilder
-
public final class ValueBuilder extends Object
- Author:
- BaseX Team 2005-24, BSD License, Leo Woerteler
-
-
Constructor Summary
Constructors Constructor Description ValueBuilder(QueryContext qc)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ValueBuilder
add(Item item)
Appends an item to the built value.ValueBuilder
add(Value value)
Appends a value to the built value.ValueBuilder
addFront(Item item)
Adds an item to the front of the built value.static Value
concat(Item item1, Item item2)
Concatenates two items.static Value
concat(Value value1, Value value2, QueryContext qc)
Concatenates two values.String
toString()
Value
value()
Returns aValue
representation of the items currently stored in this builder.Value
value(Expr expr)
Returns aValue
representation of the items currently stored in this builder annotated with the type of the given expression.Value
value(Type type)
Returns aValue
representation of the items currently stored in this builder annotated with the given item type.
-
-
-
Constructor Detail
-
ValueBuilder
public ValueBuilder(QueryContext qc)
Constructor.- Parameters:
qc
- query context (required for interrupting running queries)
-
-
Method Detail
-
concat
public static Value concat(Value value1, Value value2, QueryContext qc)
Concatenates two values.- Parameters:
value1
- first value to concatenatevalue2
- second value to concatenateqc
- query context- Returns:
- concatenated values
-
concat
public static Value concat(Item item1, Item item2)
Concatenates two items.- Parameters:
item1
- first item to concatenateitem2
- second item to concatenate- Returns:
- concatenated values
-
addFront
public ValueBuilder addFront(Item item)
Adds an item to the front of the built value.- Parameters:
item
- item to add- Returns:
- reference to this builder for convenience
-
add
public ValueBuilder add(Item item)
Appends an item to the built value.- Parameters:
item
- item to append- Returns:
- reference to this builder for convenience
-
add
public ValueBuilder add(Value value)
Appends a value to the built value.- Parameters:
value
- value to append- Returns:
- reference to this builder for convenience
-
value
public Value value()
Returns aValue
representation of the items currently stored in this builder.- Returns:
- value
-
value
public Value value(Type type)
Returns aValue
representation of the items currently stored in this builder annotated with the given item type.- Parameters:
type
- type (only considered if new sequence is created)- Returns:
- value
-
value
public Value value(Expr expr)
Returns aValue
representation of the items currently stored in this builder annotated with the type of the given expression.- Parameters:
expr
- expression that created the value (can benull
)- Returns:
- value
-
-