Package com.reportmill.base
Class RMKeyChainFuncs
- java.lang.Object
-
- com.reportmill.base.RMKeyChainFuncs
-
public class RMKeyChainFuncs extends java.lang.Object
This class holds all of RM's built-in key chain functions.
-
-
Constructor Summary
Constructors Constructor Description RMKeyChainFuncs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Object
abs(java.lang.Object val)
Returns the absolute value of the given value.static java.lang.Number
average(java.util.List aList, RMKeyChain aKeyChain)
Returns the average resulting by evaluating the keychain on given list objects.static java.lang.Number
averageX(java.util.List aList, RMKeyChain aKeyChain)
Returns the average resulting by evaluating the keychain on given list objects.static java.lang.Object
ceil(java.lang.Object val)
Returns the given value as a double rounded up to the nest largest integer.static java.lang.Number
count(java.util.List aList, RMKeyChain aKeyChain)
Returns the count of the given list or if keychain is present, all true values.static java.lang.Number
countDeep(java.util.List aList, RMKeyChain aKeyChain)
Returns the count of all leaf nodes in given list.static java.lang.Number
countUnique(java.util.List aList, RMKeyChain aKeyChain)
Returns the count of the unique values for a given list and key chain.static boolean
endsWith(java.lang.Object anObj, java.lang.Object aString)
Returns true if given object string ends with given string.static java.util.List
filter(java.util.List aList, RMKeyChain aKeyChain)
Returns the original list with items that fail the given boolean key chain removed.static java.lang.Object
floor(java.lang.Object val)
Returns the given value as a double truncated down to the nest smallest integer.static java.lang.Object
get(java.util.List aList, RMKeyChain aKeyChain)
Returns the specific object that meets the criteria.static java.lang.Object[]
getArgsForKeyChain(java.lang.Object obj, RMKeyChain node)
Returns an array of evaluated args for an RMKeyChain ARG_LIST, used when evaluating functions.static java.util.List
group(java.util.List aList, RMKeyChain aKeyChain)
Returns the original list grouped by the given key chain.static java.lang.Object
html(java.lang.Object val)
Returns an xstring by interpreting html commands in the given string.static java.lang.String
join(java.lang.Object aList, java.lang.Object aKeyChain, java.lang.Object aDelimiter)
Returns the result of joining results of evaluating keychain on given list objects, separated by delimiter.static java.lang.String
join(java.util.List aList, RMKeyChain aKeyChain)
Aggregator version of join.static java.lang.Object
max(java.lang.Object arg1, java.lang.Object arg2)
Returns the maximum value of the two given values.static java.lang.Object
max(java.util.List aList, RMKeyChain aKeyChain)
Returns the maximum result of evaluating the keychain on given list objects.static java.lang.Object
min(java.lang.Object arg1, java.lang.Object arg2)
Returns the minimum value of the two given values.static java.lang.Object
min(java.util.List aList, RMKeyChain aKeyChain)
Returns the minimum result of evaluating the keychain on given list objects.static java.lang.Object
pow(java.lang.Object arg1, java.lang.Object arg2)
Returns the first value raised to the power of the second value.static java.lang.Object
RMAllFontGlyphs(java.lang.Object fontName)
Returns all of the printable characters for the given font name.static java.lang.Object
RMConditional(java.lang.Object condition, java.lang.Object trueVal)
Returns the trueVal if condition is true, otherwise null.static java.lang.Object
RMConditional(java.lang.Object condition, java.lang.Object trueVal, java.lang.Object falseVal)
Returns either the trueVal or falseValue depending on whether condition is true.static java.lang.Object
RMFormat(java.lang.Object anObj)
Returns the string resulting by applying a default format to the given value.static java.lang.Object
RMUnicode(java.lang.Object num)
Returns the unicode character string for the given unicode value.static java.lang.Object
RMUnicodeRange(java.lang.Object c1, java.lang.Object c2)
Returns the unicode string for the given range of unicode values.static java.lang.Object
round(java.lang.Object val)
Returns the given value as a double rounded to the nearest integer.static java.lang.Object
rtf(java.lang.Object val)
Returns an xstring by interpreting rtf commands in the given string.static boolean
shouldRecurse(java.util.List aList, RMKeyChain aKeyChain)
Returns whether given list should be recursed into for aggregate calculations.static boolean
startsWith(java.lang.Object anObj, java.lang.Object aString)
Returns true if given object string starts with given string.static java.lang.String
substring(java.lang.Object aString, java.lang.Object start)
Returns the substring of the given string from the given index onward.static java.lang.String
substring(java.lang.Object aString, java.lang.Object start, java.lang.Object end)
Returns the substring of the given string in the given start/end range.static java.lang.Number
total(java.util.List aList, RMKeyChain aKeyChain)
Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).static java.lang.Number
total2(java.util.List aList, RMKeyChain aKeyChain)
Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).static java.lang.Number
totalX(java.util.List aList, RMKeyChain aKeyChain)
Returns the total resulting from evaluating given keychain on given list of objects (nulls short circuit).
-
-
-
Method Detail
-
getArgsForKeyChain
public static java.lang.Object[] getArgsForKeyChain(java.lang.Object obj, RMKeyChain node)
Returns an array of evaluated args for an RMKeyChain ARG_LIST, used when evaluating functions.
-
ceil
public static java.lang.Object ceil(java.lang.Object val)
Returns the given value as a double rounded up to the nest largest integer.
-
floor
public static java.lang.Object floor(java.lang.Object val)
Returns the given value as a double truncated down to the nest smallest integer.
-
round
public static java.lang.Object round(java.lang.Object val)
Returns the given value as a double rounded to the nearest integer.
-
abs
public static java.lang.Object abs(java.lang.Object val)
Returns the absolute value of the given value.
-
max
public static java.lang.Object max(java.lang.Object arg1, java.lang.Object arg2)
Returns the maximum value of the two given values.
-
min
public static java.lang.Object min(java.lang.Object arg1, java.lang.Object arg2)
Returns the minimum value of the two given values.
-
pow
public static java.lang.Object pow(java.lang.Object arg1, java.lang.Object arg2)
Returns the first value raised to the power of the second value.
-
html
public static java.lang.Object html(java.lang.Object val)
Returns an xstring by interpreting html commands in the given string.
-
rtf
public static java.lang.Object rtf(java.lang.Object val)
Returns an xstring by interpreting rtf commands in the given string.
-
RMConditional
public static java.lang.Object RMConditional(java.lang.Object condition, java.lang.Object trueVal)
Returns the trueVal if condition is true, otherwise null.
-
RMConditional
public static java.lang.Object RMConditional(java.lang.Object condition, java.lang.Object trueVal, java.lang.Object falseVal)
Returns either the trueVal or falseValue depending on whether condition is true.
-
startsWith
public static boolean startsWith(java.lang.Object anObj, java.lang.Object aString)
Returns true if given object string starts with given string.
-
endsWith
public static boolean endsWith(java.lang.Object anObj, java.lang.Object aString)
Returns true if given object string ends with given string.
-
substring
public static java.lang.String substring(java.lang.Object aString, java.lang.Object start)
Returns the substring of the given string from the given index onward.
-
substring
public static java.lang.String substring(java.lang.Object aString, java.lang.Object start, java.lang.Object end)
Returns the substring of the given string in the given start/end range.
-
join
public static java.lang.String join(java.lang.Object aList, java.lang.Object aKeyChain, java.lang.Object aDelimiter)
Returns the result of joining results of evaluating keychain on given list objects, separated by delimiter.
-
RMFormat
public static java.lang.Object RMFormat(java.lang.Object anObj)
Returns the string resulting by applying a default format to the given value.
-
RMUnicode
public static java.lang.Object RMUnicode(java.lang.Object num)
Returns the unicode character string for the given unicode value.
-
RMUnicodeRange
public static java.lang.Object RMUnicodeRange(java.lang.Object c1, java.lang.Object c2)
Returns the unicode string for the given range of unicode values.
-
RMAllFontGlyphs
public static java.lang.Object RMAllFontGlyphs(java.lang.Object fontName)
Returns all of the printable characters for the given font name.
-
total
public static java.lang.Number total(java.util.List aList, RMKeyChain aKeyChain)
Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).
-
total2
public static java.lang.Number total2(java.util.List aList, RMKeyChain aKeyChain)
Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).
-
totalX
public static java.lang.Number totalX(java.util.List aList, RMKeyChain aKeyChain)
Returns the total resulting from evaluating given keychain on given list of objects (nulls short circuit).
-
count
public static java.lang.Number count(java.util.List aList, RMKeyChain aKeyChain)
Returns the count of the given list or if keychain is present, all true values.
-
countDeep
public static java.lang.Number countDeep(java.util.List aList, RMKeyChain aKeyChain)
Returns the count of all leaf nodes in given list.
-
countUnique
public static java.lang.Number countUnique(java.util.List aList, RMKeyChain aKeyChain)
Returns the count of the unique values for a given list and key chain.
-
average
public static java.lang.Number average(java.util.List aList, RMKeyChain aKeyChain)
Returns the average resulting by evaluating the keychain on given list objects.
-
averageX
public static java.lang.Number averageX(java.util.List aList, RMKeyChain aKeyChain)
Returns the average resulting by evaluating the keychain on given list objects.
-
min
public static java.lang.Object min(java.util.List aList, RMKeyChain aKeyChain)
Returns the minimum result of evaluating the keychain on given list objects.
-
max
public static java.lang.Object max(java.util.List aList, RMKeyChain aKeyChain)
Returns the maximum result of evaluating the keychain on given list objects.
-
get
public static java.lang.Object get(java.util.List aList, RMKeyChain aKeyChain)
Returns the specific object that meets the criteria.
-
filter
public static java.util.List filter(java.util.List aList, RMKeyChain aKeyChain)
Returns the original list with items that fail the given boolean key chain removed.
-
group
public static java.util.List group(java.util.List aList, RMKeyChain aKeyChain)
Returns the original list grouped by the given key chain.
-
join
public static java.lang.String join(java.util.List aList, RMKeyChain aKeyChain)
Aggregator version of join. aKeyChain is an arglist with 2 args, as in join(getName, "\n") The first arg is the keychain to be evaluated for each object in the list, and the second arg is the separator string.
-
shouldRecurse
public static boolean shouldRecurse(java.util.List aList, RMKeyChain aKeyChain)
Returns whether given list should be recursed into for aggregate calculations.
-
-