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 doubleaverage(List aList, RMKeyChain aKeyChain) Returns the average resulting by evaluating the keychain on given list objects.static DoubleaverageX(List aList, RMKeyChain aKeyChain) Returns the average resulting by evaluating the keychain on given list objects.static intcount(List aList, RMKeyChain aKeyChain) Returns the count of the given list or if keychain is present, all non-null values.static intcountDeep(List aList, RMKeyChain aKeyChain) Returns the count of all non-null leaf nodes in given list.static intcountUnique(List aList, RMKeyChain aKeyChain) Returns the count of the unique values for a given list and key chain.static Listfilter(List aList, RMKeyChain aKeyChain) Returns the original list with items that fail the given boolean key chain removed.static Objectget(List aList, RMKeyChain aKeyChain) Returns the specific object that meets the criteria.static MethodgetAggrMethodImpl(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 ObjectgetListValue(Object anObj, RMKeyChain aKeyChain) Silly method to support DatasetKeys like: List1Key.List2Key, which returns a flattened Master/Detail list.protected RMKeyChaingetMethodArgs(RMKeyChain aKeyChain) Returns the method args.protected StringgetMethodName(RMKeyChain aKeyChain) Returns the method name for a KeyChain.static Listgroup(List aList, RMKeyChain aKeyChain) Returns the original list grouped by the given key chain.static Stringjoin(List aList, RMKeyChain aKeyChain) Aggregator version of join.static ListlistOf(List aList, RMKeyChain aKeyChain) Returns a list of objects by evaluating keychain on given list.static Objectmax(List aList, RMKeyChain aKeyChain) Returns the maximum result of evaluating the keychain on given list objects.static Objectmin(List aList, RMKeyChain aKeyChain) Returns the minimum result of evaluating the keychain on given list objects.static booleanshouldRecurse(List aList, RMKeyChain aKeyChain) Returns whether given list should be recursed into for aggregate calculations.static doubletotal(List aList, RMKeyChain aKeyChain) Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).static doubletotal2(List aList, RMKeyChain aKeyChain) Returns the total resulting from evaluating given keychain on given list of objects (nulls are zero).static DoubletotalX(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:
getKeyValuein interfaceRMKey.Get
-
getKeyChainValue
Override to give list chance to implement this.- Specified by:
getKeyChainValuein 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.
-