Package com.inductiveautomation.rm.base
Class RMKeyChainAggr
java.lang.Object
com.inductiveautomation.rm.base.RMKeyChainAggr
- All Implemented Interfaces:
RMKey.Get
,RMKeyChain.Get
A class to evaluate keys on lists.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
average
(List aList, RMKeyChain aKeyChain) Returns the average resulting by evaluating the keychain on given list objects.static Double
averageX
(List aList, RMKeyChain aKeyChain) Returns the average resulting by evaluating the keychain on given list objects.static int
count
(List aList, RMKeyChain aKeyChain) Returns the count of the given list or if keychain is present, all non-null values.static int
countDeep
(List aList, RMKeyChain aKeyChain) Returns the count of all non-null leaf nodes in given list.static int
countUnique
(List aList, RMKeyChain aKeyChain) Returns the count of the unique values for a given list and key chain.static List
filter
(List aList, RMKeyChain aKeyChain) Returns the original list with items that fail the given boolean key chain removed.static Object
get
(List aList, RMKeyChain aKeyChain) Returns the specific object that meets the criteria.static Method
getAggrMethodImpl
(String aName) Returns a method for a method name (assuming {List,KeyChain} args).getKeyChainValue
(Object aRoot, RMKeyChain aKeyChain) Override to give list chance to implement this.getKeyValue
(String aKey) Override to give list chance to implement this.static Object
getListValue
(Object anObj, RMKeyChain aKeyChain) Silly method to support DatasetKeys like: List1Key.List2Key, which returns a flattened Master/Detail list.protected RMKeyChain
getMethodArgs
(RMKeyChain aKeyChain) Returns the method args.protected String
getMethodName
(RMKeyChain aKeyChain) Returns the method name for a KeyChain.static List
group
(List aList, RMKeyChain aKeyChain) Returns the original list grouped by the given key chain.static String
join
(List aList, RMKeyChain aKeyChain) Aggregator version of join.static List
listOf
(List aList, RMKeyChain aKeyChain) Returns a list of objects by evaluating keychain on given list.static Object
max
(List aList, RMKeyChain aKeyChain) Returns the maximum result of evaluating the keychain on given list objects.static Object
min
(List aList, RMKeyChain aKeyChain) Returns the minimum result of evaluating the keychain on given list objects.static boolean
shouldRecurse
(List aList, RMKeyChain aKeyChain) Returns whether given list should be recursed into for aggregate calculations.static double
total
(List aList, RMKeyChain aKeyChain) Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).static double
total2
(List aList, RMKeyChain aKeyChain) Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).static Double
totalX
(List aList, RMKeyChain aKeyChain) Returns the total resulting from evaluating given keychain on given list of objects (nulls short circuit).
-
Constructor Details
-
RMKeyChainAggr
Creates a new RMKeyChainAggregator.
-
-
Method Details
-
getKeyValue
Override to give list chance to implement this.- Specified by:
getKeyValue
in interfaceRMKey.Get
-
getKeyChainValue
Override to give list chance to implement this.- Specified by:
getKeyChainValue
in interfaceRMKeyChain.Get
-
getMethodName
Returns the method name for a KeyChain. -
getMethodArgs
Returns the method args. -
getAggrMethodImpl
Returns a method for a method name (assuming {List,KeyChain} args). -
total
Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero). -
total2
Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero). -
totalX
Returns the total resulting from evaluating given keychain on given list of objects (nulls short circuit). -
count
Returns the count of the given list or if keychain is present, all non-null values. -
countDeep
Returns the count of all non-null leaf nodes in given list. -
countUnique
Returns the count of the unique values for a given list and key chain. -
average
Returns the average resulting by evaluating the keychain on given list objects. -
averageX
Returns the average resulting by evaluating the keychain on given list objects. -
min
Returns the minimum result of evaluating the keychain on given list objects. -
max
Returns the maximum result of evaluating the keychain on given list objects. -
get
Returns the specific object that meets the criteria. -
filter
Returns the original list with items that fail the given boolean key chain removed. -
group
Returns the original list grouped by the given key chain. -
join
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 list, and the second arg is the separator string. -
listOf
Returns a list of objects by evaluating keychain on given list. -
shouldRecurse
Returns whether given list should be recursed into for aggregate calculations. -
getListValue
Silly method to support DatasetKeys like: List1Key.List2Key, which returns a flattened Master/Detail list.
-