org.omwg.mediation.mappingstore.query
Class ValueRestriction

java.lang.Object
  extended byorg.omwg.mediation.mappingstore.query.ValueRestriction
All Implemented Interfaces:
Restriction

public class ValueRestriction
extends java.lang.Object
implements Restriction

The ValueRestriction is used to implement range restriction or equals for numbers. To add a range restriction use two ValueRestrictions with LOWER and UPPER bounds.


Field Summary
static int EQUAL
           
static int LOWER
           
static int NO_RESTRICTION
           
static int UPPER
           
 
Constructor Summary
ValueRestriction(int typeOfRestriction, java.lang.Comparable value)
          Constructs basic restriction by comparable object and type.
 
Method Summary
 boolean admit(java.lang.Object o)
          This method is speciifed by Restriction Interface
 java.lang.String reduceToLuceneQuery(java.lang.String field)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_RESTRICTION

public static final int NO_RESTRICTION
See Also:
Constant Field Values

LOWER

public static final int LOWER
See Also:
Constant Field Values

UPPER

public static final int UPPER
See Also:
Constant Field Values

EQUAL

public static final int EQUAL
See Also:
Constant Field Values
Constructor Detail

ValueRestriction

public ValueRestriction(int typeOfRestriction,
                        java.lang.Comparable value)
Constructs basic restriction by comparable object and type. The range of the first argument is set of values of class variables referring to the type of the restriction.

Parameters:
typeOfRestriction - given restriction type
value - given comparable object
Method Detail

admit

public boolean admit(java.lang.Object o)
This method is speciifed by Restriction Interface

Specified by:
admit in interface Restriction
Parameters:
o - given object of type Comparable
Returns:
True if the Comparable object satisfies the restrictions, otherwise returns False.

reduceToLuceneQuery

public java.lang.String reduceToLuceneQuery(java.lang.String field)
Specified by:
reduceToLuceneQuery in interface Restriction