com.indexdata.torus2.query
Class QueryMatcher

java.lang.Object
  extended by com.indexdata.torus2.query.QueryMatcher

public class QueryMatcher
extends Object

Document querying logic, TODO turn this into a non-static class and cache compiled regexes and whatnot.

Author:
jakub

Nested Class Summary
static class QueryMatcher.Tokenizer
           
 
Constructor Summary
QueryMatcher()
           
 
Method Summary
static boolean equalsWildcard(String pattern, int patternAt, String text, int textAt)
           
static boolean matchIp(String low, String high, String value)
           
static boolean matchQuery(Record.Layer layer, org.z3950.zing.cql.CQLNode query)
           
static String normalizeTokens(String src, String sep, QueryMatcher.Tokenizer.TokenizerType type)
           
static org.z3950.zing.cql.CQLNode parseQuery(String query)
          Parses query string into tree representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryMatcher

public QueryMatcher()
Method Detail

parseQuery

public static org.z3950.zing.cql.CQLNode parseQuery(String query)
                                             throws QueryException
Parses query string into tree representation

Parameters:
query -
Returns:
parsed query or null if query string was null or empty
Throws:
QueryException - when query is malformed or cannot be read

normalizeTokens

public static String normalizeTokens(String src,
                                     String sep,
                                     QueryMatcher.Tokenizer.TokenizerType type)

equalsWildcard

public static boolean equalsWildcard(String pattern,
                                     int patternAt,
                                     String text,
                                     int textAt)

matchQuery

public static boolean matchQuery(Record.Layer layer,
                                 org.z3950.zing.cql.CQLNode query)
                          throws QueryException
Throws:
QueryException

matchIp

public static boolean matchIp(String low,
                              String high,
                              String value)


Copyright © 2008-2012 Index Data. All Rights Reserved.