Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.6.0)
E15995-05


oracle.webcenter.search.refine
Class DateRefinement

java.lang.Object
  extended by oracle.webcenter.search.refine.Refinement<java.util.Calendar>
      extended by oracle.webcenter.search.refine.DateRefinement

All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class DateRefinement
extends Refinement<java.util.Calendar>

A Calendar based refinement that captures a lot of the logic dates go through when used as Refiners for a search.

Since:
11.1.1.0.0 Beta 2
See Also:
Serialized Form

Nested Class Summary
static class DateRefinement.DateClause
           
static interface DateRefinement.DateRefinementListener
           

 

Nested classes/interfaces inherited from class oracle.webcenter.search.refine.Refinement
Refinement.Clause<T>

 

Constructor Summary
DateRefinement(java.util.Calendar date, int count, DateRefinement.DateRefinementListener listener)
          Constructs a DateRefinement with one single Calendar value and the number of times that Calendar value shows up.
DateRefinement(java.util.List<Refinement.Clause<java.util.Calendar>> clauses, int count, DateRefinement.DateRefinementListener listener)
          Constructs a DateRefinement with a List of clauses and a count.

 

Method Summary
protected  void addAttributePredicate(java.util.List<Predicate> children, AttributePredicate<java.util.Calendar> newPredicate)
          Adds an attribute predicate to the list of Predicate objects held within a top-level ComplexPredicate.
protected  void buildName(java.util.Calendar calendar)
          Builds the name of the DateRefinement with a Calendar by formatting it and setting the name to be that String value.
protected  AttributePredicate<java.util.Calendar> createPredicate(QName name, java.lang.String comparator, java.util.Calendar value)
           
 java.util.Calendar getCalendarSinceNumDays(java.util.Calendar cal)
           
static java.util.Calendar getCalendarSinceNumDays(java.util.Calendar cal, java.util.TimeZone timeZone)
          Get Calendar object for query execution of SinceNumDays comparator
 ComplexPredicate.ConjunctionOp getConjunctionOp()
          Returns the conjunction operator for this DateRefinement.
static int getNumDays(java.util.Date date)
          Get number of days from Date object of operand of SinceNumDays comparator
static java.util.Calendar getNumDaysAsCalendar(int num)
          Get Calendar object for operand of SinceNumDays comparator
 java.util.Calendar getYear()
          If refinement is a yearly refinement, return a calendar object of the year.
 boolean hasMatch(java.util.Calendar value)
          Returns whether the calendar value passed in matches the criteria held in this Refinement.
 boolean hasMatch(java.util.Calendar value, java.lang.String comparator, java.util.Calendar clauseValue)
          Matches a Calendar value with a criterion made up of a comparator and another Calendar.
protected  java.util.List<Refinement.Clause<java.util.Calendar>> initClauses(java.util.Calendar value, java.lang.String comparator)
           
 boolean isAccumulative()
          Is this refinement accumulative over another refinement?
 boolean isDaily()
          Is calendar type daily?
 boolean isMonthly()
          Is calendar type monthly?
 boolean isSinceNumDays()
          Is calender type since num days?
 boolean isYearly()
          Is calendar type yearly?
 void setAccumulative(boolean value)
          Set the accumulative characteristic of this refinement
 void setCalendarType(int value)
          Set calendar type

 

Methods inherited from class oracle.webcenter.search.refine.Refinement
buildName, buildName, getClauses, getCount, getName, getValue, increment, increment, isCurrent, refine, setCount, setCurrent, setName, toString

 

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

 

Constructor Detail

DateRefinement

public DateRefinement(java.util.List<Refinement.Clause<java.util.Calendar>> clauses,
                      int count,
                      DateRefinement.DateRefinementListener listener)
Constructs a DateRefinement with a List of clauses and a count.
Parameters:
clauses - the List off Refinement.Clause objects to be used in this Refinement.
count - the number of results expected when this DateRefinement is applied
listener - the implementation class of the listener interface

DateRefinement

public DateRefinement(java.util.Calendar date,
                      int count,
                      DateRefinement.DateRefinementListener listener)
Constructs a DateRefinement with one single Calendar value and the number of times that Calendar value shows up.
Parameters:
date - the Calendar value based on which an EQUALS clause is built
count - the number of results expected when this DateRefinement
listener - the implementation class of the listener interface is applied

Method Detail

initClauses

protected java.util.List<Refinement.Clause<java.util.Calendar>> initClauses(java.util.Calendar value,
                                                                            java.lang.String comparator)
Overrides:
initClauses in class Refinement<java.util.Calendar>

isAccumulative

public boolean isAccumulative()
Is this refinement accumulative over another refinement?

setAccumulative

public void setAccumulative(boolean value)
Set the accumulative characteristic of this refinement

setCalendarType

public void setCalendarType(int value)
Set calendar type
Parameters:
value - Calendar field constant

isYearly

public boolean isYearly()
Is calendar type yearly?

isMonthly

public boolean isMonthly()
Is calendar type monthly?

isDaily

public boolean isDaily()
Is calendar type daily?

isSinceNumDays

public boolean isSinceNumDays()
Is calender type since num days?

getYear

public java.util.Calendar getYear()
If refinement is a yearly refinement, return a calendar object of the year.

createPredicate

protected AttributePredicate<java.util.Calendar> createPredicate(QName name,
                                                                 java.lang.String comparator,
                                                                 java.util.Calendar value)
Overrides:
createPredicate in class Refinement<java.util.Calendar>

buildName

protected void buildName(java.util.Calendar calendar)
Builds the name of the DateRefinement with a Calendar by formatting it and setting the name to be that String value.
Specified by:
buildName in class Refinement<java.util.Calendar>
Parameters:
calendar - the Calendar value to use to build the name

getConjunctionOp

public ComplexPredicate.ConjunctionOp getConjunctionOp()
Returns the conjunction operator for this DateRefinement.
Specified by:
getConjunctionOp in class Refinement<java.util.Calendar>
Returns:
a ConjunctionOp value that is either an And or an Or.

addAttributePredicate

protected void addAttributePredicate(java.util.List<Predicate> children,
                                     AttributePredicate<java.util.Calendar> newPredicate)
                              throws ContradictionException
Adds an attribute predicate to the list of Predicate objects held within a top-level ComplexPredicate. The assumption on the top-level ComplexPredicate is that it serves only one Refiner and therefore in this case, we only care about the DateRefiner.
Overrides:
addAttributePredicate in class Refinement<java.util.Calendar>
Parameters:
children - a List of child Predicates coming from a ComplexPredicate dedicated to a DateRefiner.
newPredicate - the new Predicate to be added to the list of child Predicates.
Throws:
ContradictionException

hasMatch

public final boolean hasMatch(java.util.Calendar value)
Returns whether the calendar value passed in matches the criteria held in this Refinement.
Specified by:
hasMatch in class Refinement<java.util.Calendar>
Parameters:
value - the Calendar value to be matched.
Returns:
true if the value falls within the range defined by this Refinement.

hasMatch

public final boolean hasMatch(java.util.Calendar value,
                              java.lang.String comparator,
                              java.util.Calendar clauseValue)
Matches a Calendar value with a criterion made up of a comparator and another Calendar.
Parameters:
value - the value to compare
comparator - the comparator to use
clauseValue - the value to compare against
Returns:
true if the value compares positively with the comparator and the clause value.

getNumDaysAsCalendar

public static final java.util.Calendar getNumDaysAsCalendar(int num)
Get Calendar object for operand of SinceNumDays comparator
Parameters:
num - number of days
Returns:
Calendar representing the operand of SinceNumDays comparator

getCalendarSinceNumDays

public final java.util.Calendar getCalendarSinceNumDays(java.util.Calendar cal)

getCalendarSinceNumDays

public static final java.util.Calendar getCalendarSinceNumDays(java.util.Calendar cal,
                                                               java.util.TimeZone timeZone)
Get Calendar object for query execution of SinceNumDays comparator
Parameters:
cal - representing the operand of SinceNumDays comparator
Returns:
Calendar representing the calendar for SinceNumDays comparator

getNumDays

public static final int getNumDays(java.util.Date date)
Get number of days from Date object of operand of SinceNumDays comparator
Parameters:
date - Date object of operand of SinceNumDays comparator
int - value of NumDays

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.6.0)
E15995-05


Copyright © 2009, 2012, Oracle and/or its affiliates. All rights reserved.