Package com.reportmill.base
Class RMKeyChain
java.lang.Object
com.reportmill.base.RMKeyChain
This class provides the powerful RMKeyChain.valueForKeyChain() functiionality.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final bytestatic final byte
- 
Constructor SummaryConstructorsConstructorDescriptionRMKeyChain(byte oper) Node constructor.RMKeyChain(byte oper, Object child) Node constructor.RMKeyChain(byte oper, Object left, Object right) Node constructor.RMKeyChain(Object cond, Object tExp, Object fExp) Node constructor.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a child to the end of the keychain's child list.static voidAdds a class to the list of classes that RM queries for functions.booleananyKeyReferencesKey(String aKey) Returns whether given key is used anywhere in expression.static booleanbooleanValueForKeyChain(Object anObj, Object aKeyChain) VFK convenience - returns a boolean for an object and keychain.clone()Standard clone implementation.static doubledoubleValueForKeyChain(Object anObj, Object aKeyChain) VFK convenience - returns a double for an object and keychain.booleanStandard equals implementation.static MethodfindAggregateMethod(String aString) Returns a method for a method name (assuming {List,KeyChain} args).static MethodfindFunctionMethod(String aString, Class[] argClasses) Returns a method for a method name and the given argument classes.static floatfloatValueForKeyChain(Object anObj, Object aKeyChain) VFK convenience - returns a float for an object and keychain.static StringReturns the last error encountered by the keychain parser and resets paser.static MapReturns a thread-local assignments map.getChild(int i) Returns the child at the given index in the keychain.intReturns the number of children in the keychain.getChildKeyChain(int i) Returns the child at the given index in the keychain as a keychain.getChildString(int i) Returns the child at the given index in the keychain as a string.static StringgetError()Returns the last error encountered by the keychain parser (or null).getNext()Returns the next keychain in the chain.byteReturns the top level operand of the keychain.getValue()Returns the value of the keychain.Returns the value of the keychain as a string.booleanReturns whether key has an aggregate key in it.booleanhasOp(int anOp) Returns whether key contains given op.booleanReturns whether given key has a Page/PageMax key reference.static intintValueForKeyChain(Object anObj, Object aKeyChain) VFK convenience - returns an int for an object and keychain.static RMKeyChainReturns a keyChain for aSource (should be a String or existing RMKeyChain).static ListlistValueForKeyChain(Object anObj, Object aKeyChain) VFK convenience - returns a list for an object and keychain.static voidSimple main implementation, so RM's expressions can be used for simple math.voidSets the last node in the keychain.voidsetNext(RMKeyChain aKeyChain) Sets the next keychain in the chain.voidSets the value of the keychain.static voidsetValueForKeyChain(Object anObj, Object aKeyChain, Object aValue) static StringstringValueForKeyChain(Object anObj, Object aKeyChain) VFK convenience - returns a string for an object and keychain.static Objectsuper_valueForKeyChain(Object anObj, RMKeyChain aKeyChain) Returns the result of evaluating the given key chain on the given object.toString()Returns a string representation of the keychain.static ObjectvalueForKeyChain(Object anObj, Object aKeyChain) Returns the result of evaluating the given key chain on the given object.static ObjectvalueForKeyChainFunctionCall(Object anObj, RMKeyChain aKeyChain) Returns the result of evaluating the given key chain (assumed to be a function) on the given object.static ObjectvalueForKeyChainKey(Object anObj, RMKeyChain aKeyChain) Returns the result of evaluating the given key chain (assumed to be a simple key) on the given object.static ObjectvalueForKeyChainList(List aList, RMKeyChain aKeyChain) Returns the result of evaluating the given keychain on the given list.
- 
Field Details- 
Addpublic static final byte Add- See Also:
 
- 
Subtractpublic static final byte Subtract- See Also:
 
- 
Multiplypublic static final byte Multiply- See Also:
 
- 
Dividepublic static final byte Divide- See Also:
 
- 
Modpublic static final byte Mod- See Also:
 
- 
Negatepublic static final byte Negate- See Also:
 
- 
Keypublic static final byte Key- See Also:
 
- 
Valuepublic static final byte Value- See Also:
 
- 
Stringpublic static final byte String- See Also:
 
- 
ArgListpublic static final byte ArgList- See Also:
 
- 
FunctionCallpublic static final byte FunctionCall- See Also:
 
- 
ArrayIndexpublic static final byte ArrayIndex- See Also:
 
- 
Nullpublic static final byte Null- See Also:
 
- 
GreaterThanpublic static final byte GreaterThan- See Also:
 
- 
LessThanpublic static final byte LessThan- See Also:
 
- 
GreaterThanOrEqualpublic static final byte GreaterThanOrEqual- See Also:
 
- 
LessThanOrEqualpublic static final byte LessThanOrEqual- See Also:
 
- 
Equalpublic static final byte Equal- See Also:
 
- 
NotEqualpublic static final byte NotEqual- See Also:
 
- 
Notpublic static final byte Not- See Also:
 
- 
Andpublic static final byte And- See Also:
 
- 
Orpublic static final byte Or- See Also:
 
- 
Conditionalpublic static final byte Conditional- See Also:
 
- 
Assignmentpublic static final byte Assignment- See Also:
 
 
- 
- 
Constructor Details- 
RMKeyChainpublic RMKeyChain(byte oper) Node constructor.
- 
RMKeyChainNode constructor.
- 
RMKeyChainNode constructor.
- 
RMKeyChainNode constructor.
 
- 
- 
Method Details- 
keyChainReturns a keyChain for aSource (should be a String or existing RMKeyChain).
- 
getAssignmentsReturns a thread-local assignments map.
- 
getOperandpublic byte getOperand()Returns the top level operand of the keychain.
- 
getNextReturns the next keychain in the chain.
- 
setNextSets the next keychain in the chain.
- 
setLastNodeSets the last node in the keychain.
- 
getValueReturns the value of the keychain.
- 
getValueStringReturns the value of the keychain as a string.
- 
setValueSets the value of the keychain.
- 
getChildCountpublic int getChildCount()Returns the number of children in the keychain.
- 
getChildReturns the child at the given index in the keychain.
- 
getChildStringReturns the child at the given index in the keychain as a string.
- 
getChildKeyChainReturns the child at the given index in the keychain as a keychain.
- 
addChildAdds a child to the end of the keychain's child list.
- 
valueForKeyChainReturns the result of evaluating the given key chain on the given object.
- 
setValueForKeyChain
- 
super_valueForKeyChainReturns the result of evaluating the given key chain on the given object. Broken out so objects can implement custom valueForKeyChain but still have access to default implementation.
- 
valueForKeyChainKeyReturns the result of evaluating the given key chain (assumed to be a simple key) on the given object.
- 
valueForKeyChainFunctionCallReturns the result of evaluating the given key chain (assumed to be a function) on the given object.
- 
valueForKeyChainListReturns the result of evaluating the given keychain on the given list.
- 
stringValueForKeyChainVFK convenience - returns a string for an object and keychain.
- 
intValueForKeyChainVFK convenience - returns an int for an object and keychain.
- 
floatValueForKeyChainVFK convenience - returns a float for an object and keychain.
- 
doubleValueForKeyChainVFK convenience - returns a double for an object and keychain.
- 
booleanValueForKeyChainVFK convenience - returns a boolean for an object and keychain.
- 
listValueForKeyChainVFK convenience - returns a list for an object and keychain.
- 
addFunctionClassAdds a class to the list of classes that RM queries for functions.
- 
findAggregateMethodReturns a method for a method name (assuming {List,KeyChain} args).
- 
findFunctionMethodReturns a method for a method name and the given argument classes.
- 
anyKeyReferencesKeyReturns whether given key is used anywhere in expression. Current version is really hard coded to require key to be isolated (not a part of a key chain).
- 
hasPageReferencepublic boolean hasPageReference()Returns whether given key has a Page/PageMax key reference.
- 
hasOppublic boolean hasOp(int anOp) Returns whether key contains given op.
- 
hasAggregatepublic boolean hasAggregate()Returns whether key has an aggregate key in it.
- 
getErrorReturns the last error encountered by the keychain parser (or null).
- 
getAndResetErrorReturns the last error encountered by the keychain parser and resets paser.
- 
toStringReturns a string representation of the keychain.
- 
cloneStandard clone implementation.
- 
equalsStandard equals implementation.
- 
mainSimple main implementation, so RM's expressions can be used for simple math.
 
-