Package com.inductiveautomation.rm.base
Class RMKeyChainFuncs
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMKeyChainFuncs
-
public class RMKeyChainFuncs extends java.lang.Object
This class represents an RM function call (method plus args) and defines a bunch of built-in functions.
-
-
Constructor Summary
Constructors Constructor Description RMKeyChainFuncs(java.lang.reflect.Method aMethod, java.lang.Object[] theArgs)
Creates a function call.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static double
abs(java.lang.Object val)
Returns the absolute value of the given value.static void
addFunctionClass(java.lang.Class aClass)
Adds a class to the list of classes that RM queries for functions.static long
ceil(java.lang.Object val)
Returns the given value as a double rounded up to the nest largest integer.static boolean
endsWith(java.lang.Object anObj, java.lang.Object aString)
Returns true if given object string ends with given string.static boolean
endsWith(java.lang.String aString, java.lang.Object post)
Returns whether given string ends with other given string (category method).static java.lang.String
fix(java.lang.String aString, java.lang.Object aLength)
Fixes the given string to the given length, padding by space.static java.lang.String
fix(java.lang.String aString, java.lang.Object aLength, java.lang.Object aPad)
Fixes the given string to the given length with the given pad string.static long
floor(java.lang.Object val)
Returns the given value as a double truncated down to the nest smallest integer.static java.lang.String
format(java.lang.Double aDouble, java.lang.Object aFormatString)
Returns string format of given Double using given decimal format string (category method).static java.lang.String
format(java.lang.Float aFloat, java.lang.Object aFormatString)
Returns string format of given Float using given decimal format string (category method).static java.lang.String
format(java.lang.Integer anInt, java.lang.Object aFormatString)
Returns string format of given Integer using given decimal format string (category method).static java.lang.String
format(java.lang.Number aNumber, java.lang.Object aFormatString)
Returns string format of given number using given decimal format string (category method).static java.lang.String
format(java.math.BigDecimal aDecimal, java.lang.Object aFormatString)
Returns string format of given BigDecimal using given decimal format string (category method).static java.lang.String
format(java.util.Date aDate, java.lang.Object stringObj)
Returns string format of given date, using given date format string (category method).static RMKeyChainFuncs
getFunctionCall(java.lang.Object aRoot, java.lang.Object anObj, RMKeyChain aKeyChain)
Find the Method to invoke for evaluating the given key chain (assumed to be a function) on the given object.static java.lang.Object
html(java.lang.Object aValue)
Returns an xstring by interpreting html commands in the given string.java.lang.Object
invoke(java.lang.Object anObj)
Invoke method.boolean
isEmpty(java.lang.Object anObject)
Returns whether given string is empty (or null).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.util.List
list(java.lang.Object... theObjects)
Returns a list of the given args.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
min(java.lang.Object arg1, java.lang.Object arg2)
Returns the minimum value of the two given values.static java.lang.Number
number(java.lang.String aString)
Returns a number for a given string.static java.lang.String
pad(java.lang.String aString, java.lang.Object aLength)
Returns the given string padded by the given string to be the given length (category method).static java.lang.String
pad(java.lang.String aString, java.lang.Object aPad, java.lang.Object aLength)
Returns the given string padded by the given string to be the given length (category method).static java.lang.String
padLeft(java.lang.String aString, java.lang.Object aPad, java.lang.Object aLength)
Returns the given string padded by the given string to be the given length (category method).static java.lang.Double
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
RMAllFonts(java.lang.Object aSize)
Returns a string with all fonts names rendered as the fonts themselves (at the given size).static java.lang.Object
RMConditional(java.lang.Object v, java.lang.Object t)
Returns the trueVal if condition is true, otherwise null.static java.lang.Object
RMConditional(java.lang.Object v, java.lang.Object t, java.lang.Object f)
static java.lang.Object
RMHTML(java.lang.Object aValue)
Returns an xstring by interpreting html commands in the given string.static RMXString
RMImage(java.lang.Object aSource)
Returns an xstring with an embedded image shape for given image source.static java.lang.Object
RMRTF(java.lang.Object aValue)
Returns an xstring by interpreting rtf commands in the given string.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.String
roman(java.lang.Number aNumber)
Formats the given object in roman numerals.static java.lang.String
roman(java.lang.Object anObj)
Formats the given object in roman numerals.static long
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 aValue)
Returns an xstring by interpreting rtf commands in the given string.static java.lang.String[]
split(java.lang.Object aString, java.lang.Object aRegex)
Returns an array of strings by splitting given string with given regex separator.static boolean
startsWith(java.lang.Object anObj, java.lang.Object aString)
Returns true if given object string starts with given string.static boolean
startsWith(java.lang.String aString, java.lang.Object pre)
Returns whether given string starts with other given string (category method).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.String
substring(java.lang.String aString, java.lang.Object start)
Returns substring of given string from given start index (category method).static java.lang.String
substring(java.lang.String aString, java.lang.Object start, java.lang.Object end)
Returns substring of given string from given start index to given end index (category method).static java.lang.String
wrap(java.lang.String aString, java.lang.Object aLength)
Wraps the given string to a max of given length by adding newlines.
-
-
-
Method Detail
-
getFunctionCall
public static RMKeyChainFuncs getFunctionCall(java.lang.Object aRoot, java.lang.Object anObj, RMKeyChain aKeyChain)
Find the Method to invoke for evaluating the given key chain (assumed to be a function) on the given object. fills args (if non-null) with the actual arguments to the function.
-
invoke
public java.lang.Object invoke(java.lang.Object anObj) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
Invoke method.- Throws:
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
-
addFunctionClass
public static void addFunctionClass(java.lang.Class aClass)
Adds a class to the list of classes that RM queries for functions.
-
isEmpty
public boolean isEmpty(java.lang.Object anObject)
Returns whether given string is empty (or null).
-
ceil
public static long ceil(java.lang.Object val)
Returns the given value as a double rounded up to the nest largest integer.
-
floor
public static long floor(java.lang.Object val)
Returns the given value as a double truncated down to the nest smallest integer.
-
round
public static long round(java.lang.Object val)
Returns the given value as a double rounded to the nearest integer.
-
abs
public static double 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.Double 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 aValue)
Returns an xstring by interpreting html commands in the given string.
-
rtf
public static java.lang.Object rtf(java.lang.Object aValue)
Returns an xstring by interpreting rtf commands in the given string.
-
RMHTML
public static java.lang.Object RMHTML(java.lang.Object aValue)
Returns an xstring by interpreting html commands in the given string.
-
RMRTF
public static java.lang.Object RMRTF(java.lang.Object aValue)
Returns an xstring by interpreting rtf commands in the given string.
-
RMImage
public static RMXString RMImage(java.lang.Object aSource)
Returns an xstring with an embedded image shape for given image source.
-
RMConditional
public static java.lang.Object RMConditional(java.lang.Object v, java.lang.Object t)
Returns the trueVal if condition is true, otherwise null.
-
RMConditional
public static java.lang.Object RMConditional(java.lang.Object v, java.lang.Object t, java.lang.Object f)
-
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.
-
split
public static java.lang.String[] split(java.lang.Object aString, java.lang.Object aRegex)
Returns an array of strings by splitting given string with given regex separator.
-
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.
-
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.
-
RMAllFonts
public static java.lang.Object RMAllFonts(java.lang.Object aSize)
Returns a string with all fonts names rendered as the fonts themselves (at the given size).
-
format
public static java.lang.String format(java.util.Date aDate, java.lang.Object stringObj)
Returns string format of given date, using given date format string (category method).
-
format
public static java.lang.String format(java.lang.Number aNumber, java.lang.Object aFormatString)
Returns string format of given number using given decimal format string (category method).
-
format
public static java.lang.String format(java.lang.Double aDouble, java.lang.Object aFormatString)
Returns string format of given Double using given decimal format string (category method).
-
format
public static java.lang.String format(java.lang.Float aFloat, java.lang.Object aFormatString)
Returns string format of given Float using given decimal format string (category method).
-
format
public static java.lang.String format(java.lang.Integer anInt, java.lang.Object aFormatString)
Returns string format of given Integer using given decimal format string (category method).
-
format
public static java.lang.String format(java.math.BigDecimal aDecimal, java.lang.Object aFormatString)
Returns string format of given BigDecimal using given decimal format string (category method).
-
substring
public static java.lang.String substring(java.lang.String aString, java.lang.Object start)
Returns substring of given string from given start index (category method).
-
substring
public static java.lang.String substring(java.lang.String aString, java.lang.Object start, java.lang.Object end)
Returns substring of given string from given start index to given end index (category method).
-
startsWith
public static boolean startsWith(java.lang.String aString, java.lang.Object pre)
Returns whether given string starts with other given string (category method).
-
endsWith
public static boolean endsWith(java.lang.String aString, java.lang.Object post)
Returns whether given string ends with other given string (category method).
-
number
public static java.lang.Number number(java.lang.String aString)
Returns a number for a given string.
-
pad
public static java.lang.String pad(java.lang.String aString, java.lang.Object aLength)
Returns the given string padded by the given string to be the given length (category method).
-
pad
public static java.lang.String pad(java.lang.String aString, java.lang.Object aPad, java.lang.Object aLength)
Returns the given string padded by the given string to be the given length (category method).
-
padLeft
public static java.lang.String padLeft(java.lang.String aString, java.lang.Object aPad, java.lang.Object aLength)
Returns the given string padded by the given string to be the given length (category method).
-
fix
public static java.lang.String fix(java.lang.String aString, java.lang.Object aLength)
Fixes the given string to the given length, padding by space.
-
fix
public static java.lang.String fix(java.lang.String aString, java.lang.Object aLength, java.lang.Object aPad)
Fixes the given string to the given length with the given pad string.
-
wrap
public static java.lang.String wrap(java.lang.String aString, java.lang.Object aLength)
Wraps the given string to a max of given length by adding newlines.
-
list
public static java.util.List list(java.lang.Object... theObjects)
Returns a list of the given args.
-
roman
public static java.lang.String roman(java.lang.Object anObj)
Formats the given object in roman numerals. If anObj is a date object, the year is formatted.
-
roman
public static java.lang.String roman(java.lang.Number aNumber)
Formats the given object in roman numerals. If anObj is a date object, the year is formatted.
-
-