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.refine
Class Refinement<T>

java.lang.Object
  extended by oracle.webcenter.search.refine.Refinement<T>

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DateRefinement, StringRefinement

public abstract class Refinement<T>
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

An abstract base class for Refinements in general. Refinements are used to refine a Predicate and are part of a Refiner that act on a particular column specified by a QName.

Since:
11.1.1.0.0 Beta 2
See Also:
Serialized Form

Nested Class Summary
static class Refinement.Clause<T>
          The Clause class describes a clause within a Refinement, which can have one or more clauses.

 

Constructor Summary
protected Refinement(java.util.List<Refinement.Clause<T>> clauses, int count)
          Creates a Refinement with a List of Refinement.Clause objects and a count of how many results are expected to return these clauses are applied.
protected Refinement(T value, int count)
          Creates a Refinement with a value of type T and a count of how many results applying this Refinement will be expected to return.
protected Refinement(T value, java.lang.String comparator, int count)
          Creates a Refinement with a value of type T a comparator, and a count of how many results applying this Refinement will be expected to return.

 

Method Summary
protected  void addAttributePredicate(java.util.List<Predicate> children, AttributePredicate<T> newPredicate)
          Subclasses should normalize the list of AttributePredicate<T> by overriding this method.
protected  void buildName(java.util.List<Refinement.Clause<T>> clauses)
          Delegate to subclasses to build the name of the Refinement given a list of clauses.
protected  void buildName(Refinement.Clause<T> clause)
          Delegate to subclasses to build the name of the Refinement given a clause.
protected abstract  void buildName(T value)
          Let the subclass build the name based on a type T that the subclass will know.
protected  AttributePredicate<T> createPredicate(QName name, java.lang.String comparator, T value)
           
protected  java.util.List<Refinement.Clause<T>> getClauses()
          Returns the list of clauses held within this Refinement.
abstract  ComplexPredicate.ConjunctionOp getConjunctionOp()
          Gets the conjunction operator that can be used to chain clauses produced by this Refinement.
 int getCount()
          Gets the number of results expected to return when this Refinement is applied.
 java.lang.String getName()
          Gets the display name of this Refinement.
 T getValue()
          Gets the value to compare against in the first clause of this Refinement.
abstract  boolean hasMatch(T value)
          Different types have different interpretations of hasMatch.
 void increment()
          Increment the count of this Refinement.
 void increment(int count)
          Increment the count of this Refinement by a certain amount.
protected  java.util.List<Refinement.Clause<T>> initClauses(T value, java.lang.String comparator)
           
 void refine(Refiner<T> refiner, ComplexPredicate topPredicate)
          Allows for refining a Query object.
 void setCount(int count)
          Sets the number of results expected to return when this Refinement is applied.
 void setName(java.lang.String name)
          Sets the display name of the Refinement.
 java.lang.String toString()
           

 

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

 

Constructor Detail

Refinement

protected Refinement(T value,
                     int count)
Creates a Refinement with a value of type T and a count of how many results applying this Refinement will be expected to return. This results in a Refinement with one Refinement.Clause testing for EQUALS with the passed in value.
Parameters:
value - a value of type T to compare against with an EQUALS comparator value
count - the number of results expected to return when this Refinement is applied

Refinement

protected Refinement(T value,
                     java.lang.String comparator,
                     int count)
Creates a Refinement with a value of type T a comparator, and a count of how many results applying this Refinement will be expected to return. This results in a Refinement with one Refinement.Clause specified by the parameters.
Parameters:
value - a value of type T to compare against
comparator - the String comparator to use for comparison taken from ComparatorConstants
count - the number of results expected to return when this Refinement is applied

Refinement

protected Refinement(java.util.List<Refinement.Clause<T>> clauses,
                     int count)
Creates a Refinement with a List of Refinement.Clause objects and a count of how many results are expected to return these clauses are applied.
Parameters:
clauses - the List of Refinement.Clause objects each representing a comparison
count - the number of results expected to return when this Refinement is applied

Method Detail

initClauses

protected java.util.List<Refinement.Clause<T>> initClauses(T value,
                                                           java.lang.String comparator)

getClauses

protected java.util.List<Refinement.Clause<T>> getClauses()
Returns the list of clauses held within this Refinement.
Returns:
a List of Refinement.Clause objects that this Refinement will apply on its subjects

buildName

protected void buildName(java.util.List<Refinement.Clause<T>> clauses)
Delegate to subclasses to build the name of the Refinement given a list of clauses.
Parameters:
clauses - the List of Refinement.Clause objects that subclasses can use to build the name of the Refinement

buildName

protected void buildName(Refinement.Clause<T> clause)
Delegate to subclasses to build the name of the Refinement given a clause.
Parameters:
clause - the Refinement.Clause objects that subclasses can use to build the name of the Refinement

buildName

protected abstract void buildName(T value)
Let the subclass build the name based on a type T that the subclass will know.
Parameters:
value - a value of type T that a subclass will use to build the name for the Refinement

hasMatch

public abstract boolean hasMatch(T value)
Different types have different interpretations of hasMatch. For now assume that the passed in parameter is single.
Parameters:
value - a value to match the clauses defined in this class
Returns:
true if a match occurs

refine

public void refine(Refiner<T> refiner,
                   ComplexPredicate topPredicate)
            throws ContradictionException
Allows for refining a Query object. Most of the time this means adding more predicates.
Parameters:
topPredicate - the Predicate object being modified
refiner - holder of Refinements that may affect the topPredicate
Throws:
ContradictionException - when the act of refining causes a contradiction to occur in the ComplexPredicate.

createPredicate

protected AttributePredicate<T> createPredicate(QName name,
                                                java.lang.String comparator,
                                                T value)

addAttributePredicate

protected void addAttributePredicate(java.util.List<Predicate> children,
                                     AttributePredicate<T> newPredicate)
                              throws ContradictionException
Subclasses should normalize the list of AttributePredicate<T> by overriding this method.
Parameters:
children - the children of the top level ComplexPredicate to refine
newPredicate - the new AttributePredicate<T> to add.
Throws:
ContradictionException

getConjunctionOp

public abstract ComplexPredicate.ConjunctionOp getConjunctionOp()
Gets the conjunction operator that can be used to chain clauses produced by this Refinement.
Returns:
a ConjunctionOp that is either ConjunctionOp.And or ConjunctionOp.Or

getValue

public T getValue()
Gets the value to compare against in the first clause of this Refinement.
Returns:
a value of type T to compare against in the first clause

getName

public java.lang.String getName()
Gets the display name of this Refinement.
Returns:
a String name of this Refinement that was built by buildName

setName

public void setName(java.lang.String name)
Sets the display name of the Refinement.
Parameters:
name - the name to set

getCount

public int getCount()
Gets the number of results expected to return when this Refinement is applied.
Returns:
an integer that estimates the number of results expected after application

setCount

public void setCount(int count)
Sets the number of results expected to return when this Refinement is applied.
Parameters:
count - an integer that estimates the number of results expected after application

increment

public void increment()
Increment the count of this Refinement. This method is useful when building Refiners in the RefinerBuilder code.

increment

public void increment(int count)
Increment the count of this Refinement by a certain amount. This method is useful when building Refiners in the RefinerBuilder code.
Parameters:
count - the count to add to the current count

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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.