clark.xpath
Class TypeAnalizer

java.lang.Object
  |
  +--clark.xpath.TypeAnalizer

public class TypeAnalizer
extends java.lang.Object

This class contains several methods for String analysis, for example if a String represents a number, or if in a String there is a certain operator.


Constructor Summary
TypeAnalizer()
           
 
Method Summary
static boolean isNumber(java.lang.String expr)
          Returns true if the String passed as an argument represents a number, integer or real.
static boolean isOperatorName(java.lang.String expr, int start, int end)
          Returns true if the substring between indexes start and end in the String in the first argument is an operator name.
static int opIndex(java.lang.String Expr, java.lang.String op)
          Searches for a sub-string representing a specified operator in the String passed as a first argument.
static int relIndex(java.lang.String expr, java.lang.String op)
          Searches for a sub-string representing a specified relational operator in the String passed as a first argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeAnalizer

public TypeAnalizer()
Method Detail

isNumber

public static boolean isNumber(java.lang.String expr)
Returns true if the String passed as an argument represents a number, integer or real.


opIndex

public static int opIndex(java.lang.String Expr,
                          java.lang.String op)
                   throws ParseException
Searches for a sub-string representing a specified operator in the String passed as a first argument. The search is backwords and takes care of opening and closing brackets. If the operator is not found -1 is returned, otherwise the start index is returned.

ParseException

relIndex

public static int relIndex(java.lang.String expr,
                           java.lang.String op)
                    throws ParseException
Searches for a sub-string representing a specified relational operator in the String passed as a first argument. The search is backwords and takes care of opening and closing brackets. If the relation is not found -1 is returned, otherwise the start index is returned.

ParseException

isOperatorName

public static boolean isOperatorName(java.lang.String expr,
                                     int start,
                                     int end)
                              throws ParseException
Returns true if the substring between indexes start and end in the String in the first argument is an operator name. It takes care of the opening and closing brackets around the operator.

ParseException