|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.expression.ExNode
com.waveset.expression.ExFunction.f_indexOf
The function node for the <indexOf> expression.
This determins the position of a substring within another string, or an element within a list.
The first argument is the value to search within, the second argument is the value to search for. If the first argument is a string, the second argument is coerced to a string, and we return the zero based index of first ocurrence of the second string within the first string. If the string is not contained, we return -1.
If the first argument is a list, the search the list for an element that is equal to the second argument. Coercion is not performed in this comparison.
If the first argument is not a string or list, -1 is returned.
If the second argument is absent and the first argument is a string, -1 is returned.
If the second argument is absent, and the first argument is a list, we will return the position of the first null element in the list.
The third argument is optional, if present it is coerced to an integer and become the starting offset for the search.
Field Summary |
Fields inherited from class com.waveset.expression.ExNode |
_bindingCount, _children, _decoration, _parent, code_id, trace |
Constructor Summary | |
ExFunction.f_indexOf()
|
Method Summary | |
protected ExValue |
evalInternal(ExState state)
Look for a substring or list element. |
java.lang.String |
getFunctionName()
Nodes representing functions must have a name. |
int |
listIndexOf(java.util.List list,
java.lang.Object element,
int offset)
General purpose utility to find the position of an element within a list, with a starting offset. |
Methods inherited from class com.waveset.expression.ExNode |
addChild, addChildren, addCommonAttributes, beginTrace, clearOwner, endTrace, eval, evalChild, evalChildToObject, evalChildToString, evalToBoolean, evalToInt, evalToObject, evalToString, getBindingCount, getChild, getChildren, getDecoration, getHiddenVariable, getLocation, getOwner, getParent, isLiteral, parseCommonAttributes, parseXml, postProcess, removeChild, resolveFunction, resolveVariable, setBindingCount, setChildren, setDecoration, setEnvironment, setLocation, setOwner, setOwner, setParent, toXml, toXml, toXml, toXmlAttributes, toXmlChildren |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExFunction.f_indexOf()
Method Detail |
public java.lang.String getFunctionName()
ExNode
getFunctionName
in class ExNode
protected ExValue evalInternal(ExState state) throws WavesetException
evalInternal
in class ExNode
WavesetException
public int listIndexOf(java.util.List list, java.lang.Object element, int offset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |