.. default-domain:: java .. highlight:: java .. package:: krpc.client.services.KRPC Expressions =========== .. type:: public class Expression A server side expression. .. method:: static Expression constantDouble(Connection connection, double value) A constant value of double precision floating point type. :param double value: .. method:: static Expression constantFloat(Connection connection, float value) A constant value of single precision floating point type. :param float value: .. method:: static Expression constantInt(Connection connection, int value) A constant value of integer type. :param int value: .. method:: static Expression constantBool(Connection connection, boolean value) A constant value of boolean type. :param boolean value: .. method:: static Expression constantString(Connection connection, String value) A constant value of string type. :param String value: .. method:: static Expression call(Connection connection, krpc.schema.KRPC.ProcedureCall call) An RPC call. :param krpc.schema.KRPC.ProcedureCall call: .. method:: static Expression equal(Connection connection, Expression arg0, Expression arg1) Equality comparison. :param Expression arg0: :param Expression arg1: .. method:: static Expression notEqual(Connection connection, Expression arg0, Expression arg1) Inequality comparison. :param Expression arg0: :param Expression arg1: .. method:: static Expression greaterThan(Connection connection, Expression arg0, Expression arg1) Greater than numerical comparison. :param Expression arg0: :param Expression arg1: .. method:: static Expression greaterThanOrEqual(Connection connection, Expression arg0, Expression arg1) Greater than or equal numerical comparison. :param Expression arg0: :param Expression arg1: .. method:: static Expression lessThan(Connection connection, Expression arg0, Expression arg1) Less than numerical comparison. :param Expression arg0: :param Expression arg1: .. method:: static Expression lessThanOrEqual(Connection connection, Expression arg0, Expression arg1) Less than or equal numerical comparison. :param Expression arg0: :param Expression arg1: .. method:: static Expression and(Connection connection, Expression arg0, Expression arg1) Boolean and operator. :param Expression arg0: :param Expression arg1: .. method:: static Expression or(Connection connection, Expression arg0, Expression arg1) Boolean or operator. :param Expression arg0: :param Expression arg1: .. method:: static Expression exclusiveOr(Connection connection, Expression arg0, Expression arg1) Boolean exclusive-or operator. :param Expression arg0: :param Expression arg1: .. method:: static Expression not(Connection connection, Expression arg) Boolean negation operator. :param Expression arg: .. method:: static Expression add(Connection connection, Expression arg0, Expression arg1) Numerical addition. :param Expression arg0: :param Expression arg1: .. method:: static Expression subtract(Connection connection, Expression arg0, Expression arg1) Numerical subtraction. :param Expression arg0: :param Expression arg1: .. method:: static Expression multiply(Connection connection, Expression arg0, Expression arg1) Numerical multiplication. :param Expression arg0: :param Expression arg1: .. method:: static Expression divide(Connection connection, Expression arg0, Expression arg1) Numerical division. :param Expression arg0: :param Expression arg1: .. method:: static Expression modulo(Connection connection, Expression arg0, Expression arg1) Numerical modulo operator. :param Expression arg0: :param Expression arg1: :returns: The remainder of arg0 divided by arg1 .. method:: static Expression power(Connection connection, Expression arg0, Expression arg1) Numerical power operator. :param Expression arg0: :param Expression arg1: :returns: arg0 raised to the power of arg1, with type of arg0 .. method:: static Expression leftShift(Connection connection, Expression arg0, Expression arg1) Bitwise left shift. :param Expression arg0: :param Expression arg1: .. method:: static Expression rightShift(Connection connection, Expression arg0, Expression arg1) Bitwise right shift. :param Expression arg0: :param Expression arg1: .. method:: static Expression cast(Connection connection, Expression arg, Type type) Perform a cast to the given type. :param Expression arg: :param Type type: Type to cast the argument to. .. method:: static Expression parameter(Connection connection, String name, Type type) A named parameter of type double. :param String name: The name of the parameter. :param Type type: The type of the parameter. :returns: A named parameter. .. method:: static Expression function(Connection connection, java.util.List parameters, Expression body) A function. :param java.util.List parameters: The parameters of the function. :param Expression body: The body of the function. :returns: A function. .. method:: static Expression invoke(Connection connection, Expression function, java.util.Map args) A function call. :param Expression function: The function to call. :param java.util.Map args: The arguments to call the function with. :returns: A function call. .. method:: static Expression createTuple(Connection connection, java.util.List elements) Construct a tuple. :param java.util.List elements: The elements. :returns: The tuple. .. method:: static Expression createList(Connection connection, java.util.List values) Construct a list. :param java.util.List values: The value. Should all be of the same type. :returns: The list. .. method:: static Expression createSet(Connection connection, java.util.Set values) Construct a set. :param java.util.Set values: The values. Should all be of the same type. :returns: The set. .. method:: static Expression createDictionary(Connection connection, java.util.List keys, java.util.List values) Construct a dictionary, from a list of corresponding keys and values. :param java.util.List keys: The keys. Should all be of the same type. :param java.util.List values: The values. Should all be of the same type. :returns: The dictionary. .. method:: static Expression toList(Connection connection, Expression arg) Convert a collection to a list. :param Expression arg: The collection. :returns: The collection as a list. .. method:: static Expression toSet(Connection connection, Expression arg) Convert a collection to a set. :param Expression arg: The collection. :returns: The collection as a set. .. method:: static Expression get(Connection connection, Expression arg, Expression index) Access an element in a tuple, list or dictionary. :param Expression arg: The tuple, list or dictionary. :param Expression index: The index of the element to access. A zero indexed integer for a tuple or list, or a key for a dictionary. :returns: The element. .. method:: static Expression count(Connection connection, Expression arg) Number of elements in a collection. :param Expression arg: The list, set or dictionary. :returns: The number of elements in the collection. .. method:: static Expression sum(Connection connection, Expression arg) Sum all elements of a collection. :param Expression arg: The list or set. :returns: The sum of the elements in the collection. .. method:: static Expression max(Connection connection, Expression arg) Maximum of all elements in a collection. :param Expression arg: The list or set. :returns: The maximum elements in the collection. .. method:: static Expression min(Connection connection, Expression arg) Minimum of all elements in a collection. :param Expression arg: The list or set. :returns: The minimum elements in the collection. .. method:: static Expression average(Connection connection, Expression arg) Minimum of all elements in a collection. :param Expression arg: The list or set. :returns: The minimum elements in the collection. .. method:: static Expression select(Connection connection, Expression arg, Expression func) Run a function on every element in the collection. :param Expression arg: The list or set. :param Expression func: The function. :returns: The modified collection. .. method:: static Expression where(Connection connection, Expression arg, Expression func) Run a function on every element in the collection. :param Expression arg: The list or set. :param Expression func: The function. :returns: The modified collection. .. method:: static Expression contains(Connection connection, Expression arg, Expression value) Determine if a collection contains a value. :param Expression arg: The collection. :param Expression value: The value to look for. :returns: Whether the collection contains a value. .. method:: static Expression aggregate(Connection connection, Expression arg, Expression func) Applies an accumulator function over a sequence. :param Expression arg: The collection. :param Expression func: The accumulator function. :returns: The accumulated value. .. method:: static Expression aggregateWithSeed(Connection connection, Expression arg, Expression seed, Expression func) Applies an accumulator function over a sequence, with a given seed. :param Expression arg: The collection. :param Expression seed: The seed value. :param Expression func: The accumulator function. :returns: The accumulated value. .. method:: static Expression concat(Connection connection, Expression arg1, Expression arg2) Concatenate two sequences. :param Expression arg1: The first sequence. :param Expression arg2: The second sequence. :returns: The first sequence followed by the second sequence. .. method:: static Expression orderBy(Connection connection, Expression arg, Expression key) Order a collection using a key function. :param Expression arg: The collection to order. :param Expression key: A function that takes a value from the collection and generates a key to sort on. :returns: The ordered collection. .. method:: static Expression all(Connection connection, Expression arg, Expression predicate) Determine whether all items in a collection satisfy a boolean predicate. :param Expression arg: The collection. :param Expression predicate: The predicate function. :returns: Whether all items satisfy the predicate. .. method:: static Expression any(Connection connection, Expression arg, Expression predicate) Determine whether any item in a collection satisfies a boolean predicate. :param Expression arg: The collection. :param Expression predicate: The predicate function. :returns: Whether any item satisfies the predicate. .. type:: public class Type A server side expression. .. method:: static Type double_(Connection connection) Double type. .. method:: static Type float_(Connection connection) Float type. .. method:: static Type int_(Connection connection) Int type. .. method:: static Type bool(Connection connection) Bool type. .. method:: static Type string(Connection connection) String type.