public class UPLList extends UPLValue
isBreakValue, isContinueValue, isEmptyReturnValue, isReturnValue, isValid, kTYPE_BOOL, kTYPE_COLOR, kTYPE_ID, kTYPE_LAMBDA, kTYPE_LIST, kTYPE_NULL, kTYPE_NUMERIC, kTYPE_PRG, kTYPE_STRING, kTYPE_UNKNOWN, kTYPE_VALUE, kTYPE_VOID, type
Constructor and Description |
---|
UPLList() |
UPLList(de.infinityloop.upcast.upl.prg.Arguments arguments) |
UPLList(de.infinityloop.upcast.upl.prg.Arguments arguments,
boolean isLiteral) |
UPLList(java.util.Collection<?> c) |
UPLList(java.util.Map<?,?> m) |
Modifier and Type | Method and Description |
---|---|
UPLList |
add(UPLList v) |
UPLValue |
add(UPLValue v)
Implements the addition of this UPLValue with the given value.
|
UPLList |
append(UPLValue value) |
UPLList |
appendAll(UPLList list) |
UPLValue |
castAs(int toType,
de.infinityloop.upcast.util.namespace.NamespaceManager namespaceManager) |
static UPLList |
castToList(UPLValue from) |
int |
compareTo(int compareType,
UPLValue to)
Compares this object with the specified object for order.
|
UPLValue |
deepCopy()
Creates a deep copy of a UPLValue.
|
UPLList |
distinctValues()
Creates a new list that contains all distinct values of this list
|
UPLValue |
eval(de.infinityloop.upcast.upl.util.Context context) |
UPLList |
exclude(UPLList except)
Creates a new list excluding all elements contained in the given list.
|
UPLList |
flatten()
Flattens the list by sequentially arranging all (recursively) nested non-list-elements into a new list.
|
de.infinityloop.upcast.upl.prg.Prg |
getArgument(int n)
Return the n-th Prg of the list.
|
de.infinityloop.upcast.upl.prg.Arguments |
getArguments() |
java.util.ArrayList<java.lang.Object> |
getAsArrayList()
Returns this UPLList as ArrayList, converting its elements to native Java types as well.
|
java.util.ArrayList<java.lang.String> |
getAsArrayListOfString()
Returns this UPLList as ArrayList, converting its elements to native Java Strings.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAsMap()
Returns this UPLList as HashMap, converting its elements to native Java types as well.
|
java.lang.String |
getAsString() |
java.lang.String |
getAsUPL() |
java.lang.String |
getDebugString() |
boolean |
getEffectiveBooleanValue()
The effective boolean value of a List is true only if it has at least one item and if all of its items cast to Bool are true.
|
int |
getLength() |
UPLValue |
getValue(int n)
Return the n-th value of the list.
|
int |
indexOf(UPLValue value) |
UPLList |
insertAscending(UPLValue value,
UPLBool removeDuplicates)
Inserts the given value to this list.
|
UPLList |
insertValue(int n,
UPLValue v) |
UPLList |
keep(UPLList intersect)
Creates a new list containing all elements also contained in the given list.
|
UPLList |
remove(int pos) |
UPLList |
setValue(int n,
UPLValue v)
Set the n-th element in this list to value v.
|
UPLList |
sort(UPLId algorithm)
Creates a new list that is sorted as specified in the parameter algorithm.
|
affirmate, castableAs, castValueToType, coerceToType, decrement, div, equals, getInstanceofDistance, getType, getType, getTypeName, getTypeName, increment, isBreakValue, isContinueValue, isEmptyReturnValue, isReturnValue, isValid, matchRating, mod, negate, not, setBreakValue, setContinueValue, setEmptyReturnValue, setReturnValue, setValid, sub, times, toString
public UPLList()
public UPLList(de.infinityloop.upcast.upl.prg.Arguments arguments)
public UPLList(de.infinityloop.upcast.upl.prg.Arguments arguments, boolean isLiteral)
public UPLList(java.util.Collection<?> c)
public UPLList(java.util.Map<?,?> m)
public UPLValue castAs(int toType, de.infinityloop.upcast.util.namespace.NamespaceManager namespaceManager) throws UPLValueException
castAs
in class UPLValue
UPLValueException
public static UPLList castToList(UPLValue from) throws UPLValueException
UPLValueException
public UPLList flatten() throws UPLValueException
UPLValueException
public UPLList distinctValues() throws UPLValueException
UPLValueException
public UPLList exclude(UPLList except) throws UPLValueException
except
- the list including all elements to be excludedUPLValueException
public UPLList keep(UPLList intersect) throws UPLValueException
intersect
- the list used to calculate the intersectionUPLValueException
public UPLList sort(UPLId algorithm) throws UPLValueException
algorithm
- the algorithm to be used for sortingUPLValueException
public UPLList insertAscending(UPLValue value, UPLBool removeDuplicates) throws UPLValueException
value
- the value to be insertedremoveDuplicates
- specifies if duplicates are to be removedUPLValueException
public UPLList append(UPLValue value) throws UPLValueException
UPLValueException
public UPLList appendAll(UPLList list) throws UPLValueException
UPLValueException
public UPLList remove(int pos) throws UPLValueException
UPLValueException
public int indexOf(UPLValue value) throws UPLValueException
UPLValueException
public UPLValue add(UPLValue v) throws UPLValueException
UPLValue
add
in class UPLValue
v
- the value to be addedUPLValueException
public UPLList add(UPLList v) throws UPLValueException
UPLValueException
public int compareTo(int compareType, UPLValue to) throws UPLValueException
UPLValue
compareTo
in class UPLValue
compareType
- see RelationalExpr: kEQ, kNEQ, kLT, kGT, kLTEQ, kGTEQto
- the Object to be comparedUPLValueException
public UPLValue eval(de.infinityloop.upcast.upl.util.Context context) throws UPLValueException
eval
in class UPLValue
UPLValueException
public boolean getEffectiveBooleanValue() throws UPLValueException
getEffectiveBooleanValue
in class UPLValue
UPLValueException
UPLValue.getEffectiveBooleanValue()
public int getLength()
public UPLValue getValue(int n)
n
- the position of the value to be returnedjava.lang.ArrayIndexOutOfBoundsException
- if the index is out of boundspublic UPLList setValue(int n, UPLValue v) throws UPLValueException
n
- the indexv
- the value to setUPLValueException
public UPLList insertValue(int n, UPLValue v) throws UPLValueException
UPLValueException
public de.infinityloop.upcast.upl.prg.Prg getArgument(int n)
n
- the position of the Prg to be returnedpublic java.util.ArrayList<java.lang.Object> getAsArrayList()
public java.util.ArrayList<java.lang.String> getAsArrayListOfString()
public java.util.Map<java.lang.String,java.lang.Object> getAsMap() throws UPLValueException
UPLValueException
public java.lang.String getAsString()
getAsString
in class UPLValue
public java.lang.String getDebugString()
getDebugString
in class UPLValue
public de.infinityloop.upcast.upl.prg.Arguments getArguments()
public UPLValue deepCopy() throws UPLValueException
UPLValue
deepCopy
in class UPLValue
UPLValueException