com.fdsapi.arrays
Class WhereClauseParser

java.lang.Object
  |
  +--com.fdsapi.arrays.WhereClauseParser

public class WhereClauseParser
extends java.lang.Object

Class that parses an entire where clause passed to ArraySQL and translates the String to calls to the ArrayFilter. For example it could take: col0, col1, col2, *. This class is not thread safe.

This class is not thread safe.



View Code


Constructor Summary
WhereClauseParser(java.lang.Object[][] data, java.lang.String whereClauseStr)
           
WhereClauseParser(java.lang.Object[][] data, java.lang.String whereClauseStr, ArrayFilter arrayFilter)
          This represents the beginning of the previous token and is used when to know to determine how big the token is
 
Method Summary
 void addWhereClause()
          If a where clause was passed in the contructor then add it else simply return
 ArrayFilter getArrayFilter()
          Get the ArrayFilter that backs this WhereClauseParser
static java.lang.String getWhereClause(java.lang.String query)
          Get the where clause from a passed in select statement.
static void main(java.lang.String[] args)
          Method that has test code for this class.
 java.lang.String[] parse()
          Parse the passed in where clause and break it along token lines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WhereClauseParser

public WhereClauseParser(java.lang.Object[][] data,
                         java.lang.String whereClauseStr,
                         ArrayFilter arrayFilter)
This represents the beginning of the previous token and is used when to know to determine how big the token is


WhereClauseParser

public WhereClauseParser(java.lang.Object[][] data,
                         java.lang.String whereClauseStr)
Method Detail

getArrayFilter

public ArrayFilter getArrayFilter()
Get the ArrayFilter that backs this WhereClauseParser


addWhereClause

public void addWhereClause()
If a where clause was passed in the contructor then add it else simply return


parse

public java.lang.String[] parse()
Parse the passed in where clause and break it along token lines. A bug: ADD ! (...) and in (...) (ignore parens)


getWhereClause

public static java.lang.String getWhereClause(java.lang.String query)
Get the where clause from a passed in select statement. 'select * from array where col0='souza' order by col1 desc' would return col0='souza'


main

public static void main(java.lang.String[] args)
Method that has test code for this class. Click 'View Code' above to view the code