|
||||||||||
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_substr
The function node for the <substr> expression.
The substr expression will extract a substring from the string value of a subexpression. There are two forms:
<substr> value start length </substr> <substr s='start' l='length'> value <substr>Using the form with the start & length specified as attributes is more concise and readable, the form with start and length as subexpressions allows these arguments to be computed.
The start index is 0 based.
If start is missing, the start index is assumed to be 0.
A start index less than 0 is normalized to 0.
A missing length or a length that is less than zero means to extract the rest of the string beginning at the start index. A length of zero will yield an empty string (but not null).
Field Summary |
Fields inherited from class com.waveset.expression.ExNode |
_bindingCount, _children, _decoration, _parent, code_id, trace |
Constructor Summary | |
ExFunction.f_substr()
|
Method Summary | |
protected ExValue |
evalInternal(ExState state)
Take a substring. |
java.lang.String |
getFunctionName()
Nodes representing functions must have a name. |
int |
getLength()
|
int |
getStart()
|
void |
parseXml(org.w3c.dom.Element e)
Override the usual parseXml so we can recognize our extended attributes. |
void |
setLength(int i)
|
void |
setStart(int i)
|
void |
toXmlAttributes(java.lang.StringBuffer b)
Add our optional attributes to the start tag of our XML serialization. |
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, postProcess, removeChild, resolveFunction, resolveVariable, setBindingCount, setChildren, setDecoration, setEnvironment, setLocation, setOwner, setOwner, setParent, toXml, toXml, toXml, toXmlChildren |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ExFunction.f_substr()
Method Detail |
public java.lang.String getFunctionName()
ExNode
getFunctionName
in class ExNode
public int getStart()
public void setStart(int i)
public int getLength()
public void setLength(int i)
public void parseXml(org.w3c.dom.Element e) throws WavesetException
parseXml
in class ExNode
WavesetException
public void toXmlAttributes(java.lang.StringBuffer b)
toXmlAttributes
in class ExNode
protected ExValue evalInternal(ExState state) throws WavesetException
We're not being especially careful about allocation here. If we need to be, then ExValue will have to have its own char[] array we can directly modify.
evalInternal
in class ExNode
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |