Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.3.0)
E15995-02


oracle.webcenter.search.util
Class PredicateUtils

java.lang.Object
  extended by oracle.webcenter.search.util.PredicateUtils


public class PredicateUtils
extends java.lang.Object

This class provides some utility methods around Predicates that developers may find useful.

Since:
11.1.1.0.0 Beta 2

Constructor Summary
PredicateUtils()
           

 

Method Summary
static void convertAllSinceNumDaysComparator(Predicate predicate)
          Convert all SinceNumDays comparators and their operands in the predicate tree
static void filterTextPredicate(Predicate predicate, java.lang.String filterString)
          Filter text predicate by the filterString
static
<T extends Predicate>
java.util.List<T>
findPredicates(java.lang.Class<T> type, Predicate predicate)
          Returns a list of Predicates that matches the class passed in.
static void flatten(ComplexPredicate predicate)
          Compacts the ComplexPredicate by flattening.
static
<T extends Predicate>
Predicate
getFirst(java.lang.Class<T> type, Predicate predicate)
          Extracts the first Predicate it finds in the descendents of a Predicate that matches the type passed in.
static java.lang.String getFirstKeywordsFromPredicate(Predicate predicate)
          Extracts the first keywords it finds in the Predicate by looking into TextPredicates.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PredicateUtils

public PredicateUtils()

Method Detail

getFirstKeywordsFromPredicate

public static final java.lang.String getFirstKeywordsFromPredicate(Predicate predicate)
Extracts the first keywords it finds in the Predicate by looking into TextPredicates.
Parameters:
predicate - a Predicate that can be either Text of Complex.
Returns:
the first string in navigating down the Predicate.

getFirst

public static final <T extends Predicate> Predicate getFirst(java.lang.Class<T> type,
                                                             Predicate predicate)
Extracts the first Predicate it finds in the descendents of a Predicate that matches the type passed in.
Parameters:
type - The Class object we want to match from the descendents of the passed in predicate
predicate - the Predicate whose descendents (via ComplexPredicate) we wish to discover Predicates of the type passed in
Returns:
the first item in a List of Predicates that matches the type criterion

findPredicates

public static final <T extends Predicate> java.util.List<T> findPredicates(java.lang.Class<T> type,
                                                                           Predicate predicate)
Returns a list of Predicates that matches the class passed in.
Parameters:
type - The Class object we want to match from the descendents of the passed in predicate
predicate - the Predicate whose descendents (via ComplexPredicate) we wish to discover Predicates of the type passed in
Returns:
a List of Predicates that matches the type criterion

flatten

public static final void flatten(ComplexPredicate predicate)
Compacts the ComplexPredicate by flattening. This means, collapsing any unnecessary hierarchies of ANDs and ORs if they are the same.
Parameters:
predicate - the ComplexPredicate to be flattened

convertAllSinceNumDaysComparator

public static void convertAllSinceNumDaysComparator(Predicate predicate)
Convert all SinceNumDays comparators and their operands in the predicate tree
Parameters:
predicate - of the query

filterTextPredicate

public static void filterTextPredicate(Predicate predicate,
                                       java.lang.String filterString)
Filter text predicate by the filterString
Parameters:
predicate - of the query
filterString -

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.3.0)
E15995-02


Copyright © 2009, 2010, Oracle. All rights reserved.