|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.medor.expression.lib.BasicOperator
org.objectweb.medor.expression.lib.IndexedLocate
Operator representing the search for a substring within a given input string, starting at a given index.
Field Summary |
Fields inherited from class org.objectweb.medor.expression.lib.BasicOperator |
expressions, result, type, verified |
Fields inherited from interface org.objectweb.medor.expression.api.Operator |
ABS, AND, AVG, BITWIZE, CONCAT, CONDAND, CONDOR, COUNT, DIV, EQUAL, FIRSTLOCATE, GREATER, GREATEREQUAL, IN, INDEXEDLOCATE, LENGTH, LOWER, LOWEREQUAL, MAX, MEMBEROF, MIN, MINUS, MOD, MULT, NAV, NOT, NOTEQUAL, NOTMEMBEROF, OR, PLUS, SQRT, SUBSTRING, SUM, UMINUS |
Constructor Summary | |
IndexedLocate()
|
|
IndexedLocate(Expression inputString,
Expression substring,
Expression fromIndex)
Constructs an IndexedLocate operator, representing the search for a substring in an input string, starting at a given index. |
Method Summary | |
Operand |
compileExpression()
Checks the semantic integrity of an expression. |
Operand |
evaluate(ParameterOperand[] pos,
java.lang.Object o)
It evaluates the expression tree and puts the result into the operand result. |
int |
evaluate(java.lang.String inputString,
java.lang.String subString,
int fromIndex)
|
int |
getOperandNumber()
|
java.lang.String |
getOperatorString()
Returns the String representing the operator in Java |
Methods inherited from class org.objectweb.medor.expression.lib.BasicOperator |
getExpression, getType, setExpression |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public IndexedLocate(Expression inputString, Expression substring, Expression fromIndex)
It is the equivalent of the Java indexOf String manipulation method.
If the substring argument occurs as a substring within the
inputString at a starting index no smaller than
fromIndex
, then the index of the first character
of the first such substring is returned. If it does not occur
as a substring starting at fromIndex
or beyond,
-1
is returned.
Unlike in Java, the index starts with 1 and not 0.
inputString
- the String in which to look.substring
- the substring to search for.fromIndex
- the index to start the search from.public IndexedLocate()
Method Detail |
public int getOperandNumber()
public Operand evaluate(ParameterOperand[] pos, java.lang.Object o) throws ExpressionException
Expression
pos
- a list of ParameterOperando
- the input Object from which values are taken for the
evaluation
ExpressionException
public Operand compileExpression() throws ExpressionException, MalformedExpressionException
Expression
MalformedExpressionException
- if syntax error
ExpressionException
public int evaluate(java.lang.String inputString, java.lang.String subString, int fromIndex)
public java.lang.String getOperatorString()
Operator
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |