Class RMKeyChainFuncs

java.lang.Object
com.inductiveautomation.rm.base.RMKeyChainFuncs

public class RMKeyChainFuncs extends 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(Method aMethod, Object[] theArgs)
    Creates a function call.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    abs(Object val)
    Returns the absolute value of the given value.
    static void
    Adds a class to the list of classes that RM queries for functions.
    static long
    ceil(Object val)
    Returns the given value as a double rounded up to the nest largest integer.
    static boolean
    endsWith(Object anObj, Object aString)
    Returns true if given object string ends with given string.
    static boolean
    endsWith(String aString, Object post)
    Returns whether given string ends with other given string (category method).
    static String
    fix(String aString, Object aLength)
    Fixes the given string to the given length, padding by space.
    static String
    fix(String aString, Object aLength, Object aPad)
    Fixes the given string to the given length with the given pad string.
    static long
    Returns the given value as a double truncated down to the nest smallest integer.
    static String
    format(Double aDouble, Object aFormatString)
    Returns string format of given Double using given decimal format string (category method).
    static String
    format(Float aFloat, Object aFormatString)
    Returns string format of given Float using given decimal format string (category method).
    static String
    format(Integer anInt, Object aFormatString)
    Returns string format of given Integer using given decimal format string (category method).
    static String
    format(Number aNumber, Object aFormatString)
    Returns string format of given number using given decimal format string (category method).
    static String
    format(BigDecimal aDecimal, Object aFormatString)
    Returns string format of given BigDecimal using given decimal format string (category method).
    static String
    format(Date aDate, Object stringObj)
    Returns string format of given date, using given date format string (category method).
    getFunctionCall(Object aRoot, 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 Object
    html(Object aValue)
    Returns an xstring by interpreting html commands in the given string.
    invoke(Object anObj)
    Invoke method.
    boolean
    isEmpty(Object anObject)
    Returns whether given string is empty (or null).
    static String
    join(Object aList, Object aKeyChain, Object aDelimiter)
    Returns the result of joining results of evaluating keychain on given list objects, separated by delimiter.
    static List
    list(Object... theObjects)
    Returns a list of the given args.
    static Object
    max(Object arg1, Object arg2)
    Returns the maximum value of the two given values.
    static Object
    min(Object arg1, Object arg2)
    Returns the minimum value of the two given values.
    static Number
    number(String aString)
    Returns a number for a given string.
    static String
    pad(String aString, Object aLength)
    Returns the given string padded by the given string to be the given length (category method).
    static String
    pad(String aString, Object aPad, Object aLength)
    Returns the given string padded by the given string to be the given length (category method).
    static String
    padLeft(String aString, Object aPad, Object aLength)
    Returns the given string padded by the given string to be the given length (category method).
    static Double
    pow(Object arg1, Object arg2)
    Returns the first value raised to the power of the second value.
    static Object
    Returns all of the printable characters for the given font name.
    static Object
    Returns a string with all fonts names rendered as the fonts themselves (at the given size).
    static Object
    Returns the trueVal if condition is true, otherwise null.
    static Object
     
    static Object
    RMHTML(Object aValue)
    Returns an xstring by interpreting html commands in the given string.
    static RMXString
    RMImage(Object aSource)
    Returns an xstring with an embedded image shape for given image source.
    static Object
    RMRTF(Object aValue)
    Returns an xstring by interpreting rtf commands in the given string.
    static Object
    Returns the unicode character string for the given unicode value.
    static Object
    Returns the unicode string for the given range of unicode values.
    static String
    roman(Number aNumber)
    Formats the given object in roman numerals.
    static String
    roman(Object anObj)
    Formats the given object in roman numerals.
    static long
    Returns the given value as a double rounded to the nearest integer.
    static Object
    rtf(Object aValue)
    Returns an xstring by interpreting rtf commands in the given string.
    static String[]
    split(Object aString, Object aRegex)
    Returns an array of strings by splitting given string with given regex separator.
    static boolean
    startsWith(Object anObj, Object aString)
    Returns true if given object string starts with given string.
    static boolean
    startsWith(String aString, Object pre)
    Returns whether given string starts with other given string (category method).
    static String
    substring(Object aString, Object start)
    Returns the substring of the given string from the given index onward.
    static String
    substring(Object aString, Object start, Object end)
    Returns the substring of the given string in the given start/end range.
    static String
    substring(String aString, Object start)
    Returns substring of given string from given start index (category method).
    static String
    substring(String aString, Object start, Object end)
    Returns substring of given string from given start index to given end index (category method).
    static String
    wrap(String aString, Object aLength)
    Wraps the given string to a max of given length by adding newlines.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RMKeyChainFuncs

      public RMKeyChainFuncs(Method aMethod, Object[] theArgs)
      Creates a function call.
  • Method Details

    • getFunctionCall

      public static RMKeyChainFuncs getFunctionCall(Object aRoot, 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

      Invoke method.
      Throws:
      InvocationTargetException
      IllegalAccessException
    • addFunctionClass

      public static void addFunctionClass(Class aClass)
      Adds a class to the list of classes that RM queries for functions.
    • isEmpty

      public boolean isEmpty(Object anObject)
      Returns whether given string is empty (or null).
    • ceil

      public static long ceil(Object val)
      Returns the given value as a double rounded up to the nest largest integer.
    • floor

      public static long floor(Object val)
      Returns the given value as a double truncated down to the nest smallest integer.
    • round

      public static long round(Object val)
      Returns the given value as a double rounded to the nearest integer.
    • abs

      public static double abs(Object val)
      Returns the absolute value of the given value.
    • max

      public static Object max(Object arg1, Object arg2)
      Returns the maximum value of the two given values.
    • min

      public static Object min(Object arg1, Object arg2)
      Returns the minimum value of the two given values.
    • pow

      public static Double pow(Object arg1, Object arg2)
      Returns the first value raised to the power of the second value.
    • html

      public static Object html(Object aValue)
      Returns an xstring by interpreting html commands in the given string.
    • rtf

      public static Object rtf(Object aValue)
      Returns an xstring by interpreting rtf commands in the given string.
    • RMHTML

      public static Object RMHTML(Object aValue)
      Returns an xstring by interpreting html commands in the given string.
    • RMRTF

      public static Object RMRTF(Object aValue)
      Returns an xstring by interpreting rtf commands in the given string.
    • RMImage

      public static RMXString RMImage(Object aSource)
      Returns an xstring with an embedded image shape for given image source.
    • RMConditional

      public static Object RMConditional(Object v, Object t)
      Returns the trueVal if condition is true, otherwise null.
    • RMConditional

      public static Object RMConditional(Object v, Object t, Object f)
    • startsWith

      public static boolean startsWith(Object anObj, Object aString)
      Returns true if given object string starts with given string.
    • endsWith

      public static boolean endsWith(Object anObj, Object aString)
      Returns true if given object string ends with given string.
    • substring

      public static String substring(Object aString, Object start)
      Returns the substring of the given string from the given index onward.
    • substring

      public static String substring(Object aString, Object start, Object end)
      Returns the substring of the given string in the given start/end range.
    • split

      public static String[] split(Object aString, Object aRegex)
      Returns an array of strings by splitting given string with given regex separator.
    • join

      public static String join(Object aList, Object aKeyChain, Object aDelimiter)
      Returns the result of joining results of evaluating keychain on given list objects, separated by delimiter.
    • RMUnicode

      public static Object RMUnicode(Object num)
      Returns the unicode character string for the given unicode value.
    • RMUnicodeRange

      public static Object RMUnicodeRange(Object c1, Object c2)
      Returns the unicode string for the given range of unicode values.
    • RMAllFontGlyphs

      public static Object RMAllFontGlyphs(Object fontName)
      Returns all of the printable characters for the given font name.
    • RMAllFonts

      public static Object RMAllFonts(Object aSize)
      Returns a string with all fonts names rendered as the fonts themselves (at the given size).
    • format

      public static String format(Date aDate, Object stringObj)
      Returns string format of given date, using given date format string (category method).
    • format

      public static String format(Number aNumber, Object aFormatString)
      Returns string format of given number using given decimal format string (category method).
    • format

      public static String format(Double aDouble, Object aFormatString)
      Returns string format of given Double using given decimal format string (category method).
    • format

      public static String format(Float aFloat, Object aFormatString)
      Returns string format of given Float using given decimal format string (category method).
    • format

      public static String format(Integer anInt, Object aFormatString)
      Returns string format of given Integer using given decimal format string (category method).
    • format

      public static String format(BigDecimal aDecimal, Object aFormatString)
      Returns string format of given BigDecimal using given decimal format string (category method).
    • substring

      public static String substring(String aString, Object start)
      Returns substring of given string from given start index (category method).
    • substring

      public static String substring(String aString, Object start, Object end)
      Returns substring of given string from given start index to given end index (category method).
    • startsWith

      public static boolean startsWith(String aString, Object pre)
      Returns whether given string starts with other given string (category method).
    • endsWith

      public static boolean endsWith(String aString, Object post)
      Returns whether given string ends with other given string (category method).
    • number

      public static Number number(String aString)
      Returns a number for a given string.
    • pad

      public static String pad(String aString, Object aLength)
      Returns the given string padded by the given string to be the given length (category method).
    • pad

      public static String pad(String aString, Object aPad, Object aLength)
      Returns the given string padded by the given string to be the given length (category method).
    • padLeft

      public static String padLeft(String aString, Object aPad, Object aLength)
      Returns the given string padded by the given string to be the given length (category method).
    • fix

      public static String fix(String aString, Object aLength)
      Fixes the given string to the given length, padding by space.
    • fix

      public static String fix(String aString, Object aLength, Object aPad)
      Fixes the given string to the given length with the given pad string.
    • wrap

      public static String wrap(String aString, Object aLength)
      Wraps the given string to a max of given length by adding newlines.
    • list

      public static List list(Object... theObjects)
      Returns a list of the given args.
    • roman

      public static String roman(Object anObj)
      Formats the given object in roman numerals. If anObj is a date object, the year is formatted.
    • roman

      public static String roman(Number aNumber)
      Formats the given object in roman numerals. If anObj is a date object, the year is formatted.