javax.slee.profile.query
Class RangeMatch

java.lang.Object
  extended by javax.slee.profile.query.QueryExpression
      extended by javax.slee.profile.query.RangeMatch
All Implemented Interfaces:
java.io.Serializable

public final class RangeMatch
extends QueryExpression

The RangeMatch class represents a dynamic query expression that checks whether the value of a profile attribute lies within a specified range. A profile matches the expression if the profile attribute value is greater than or equal to the lower bound value and less than or equal to the upper bound value.

This query expression can only be used with profile attributes whose class implements the Comparable interface.

See Also:
Serialized Form

Constructor Summary
RangeMatch(java.lang.String attrName, java.lang.Object fromValue, java.lang.Object toValue)
          Create a RangeMatch query expression.
RangeMatch(java.lang.String attrName, java.lang.String fromValue, java.lang.String toValue, QueryCollator collator)
          Create a RangeMatch query expression.
 
Method Summary
 java.lang.String getAttributeName()
          Get the name of the profile attribute used by this query expression.
 QueryCollator getCollator()
          Get the query collator used by this query expression.
 java.lang.Object getFromValue()
          Get the lower-bound value the profile attribute will be compared to.
 java.lang.Object getToValue()
          Get the upper-bound value the profile attribute will be compared to.
protected  void toString(java.lang.StringBuffer buf)
          Get a string representation for this query expression.
 
Methods inherited from class javax.slee.profile.query.QueryExpression
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RangeMatch

public RangeMatch(java.lang.String attrName,
                  java.lang.Object fromValue,
                  java.lang.Object toValue)
Create a RangeMatch query expression. A profile will match the expression criteria if the value of the attrName attribute is greater than or equal to fromValue and less than or equal to toValue, as determined by Comparable.compareTo(Object).

Parameters:
attrName - the name of the profile attribute to compare.
fromValue - the lower bound of the range.
toValue - the upper bound of the range.
Throws:
java.lang.NullPointerException - if any argument is null.
java.lang.IllegalArgumentException - if the class of fromValue or toValue does not implement the java.lang.Comparable interface.

RangeMatch

public RangeMatch(java.lang.String attrName,
                  java.lang.String fromValue,
                  java.lang.String toValue,
                  QueryCollator collator)
Create a RangeMatch query expression. A profile will match the expression criteria if the value of the attrName attribute is greater than or equal to fromValue and less than or equal to toValue, as determined by Collator.compare(String, String), where the collator is obtained from the specified QueryCollator.

Parameters:
attrName - the name of the profile attribute to compare.
fromValue - the lower bound of the range.
toValue - the upper bound of the range.
collator - the collator to use for the comparison. May be null.
Throws:
java.lang.NullPointerException - if attrName, fromValue, or toValue is null.
java.lang.IllegalArgumentException - if the class of fromValue or toValue does not implement the java.lang.Comparable interface.
Method Detail

getAttributeName

public java.lang.String getAttributeName()
Get the name of the profile attribute used by this query expression.

Returns:
the name of the profile attribute.

getFromValue

public java.lang.Object getFromValue()
Get the lower-bound value the profile attribute will be compared to.

Returns:
the lower-bound value the profile attribute will be compared to.

getToValue

public java.lang.Object getToValue()
Get the upper-bound value the profile attribute will be compared to.

Returns:
the upper-bound value the profile attribute will be compared to.

getCollator

public QueryCollator getCollator()
Get the query collator used by this query expression.

Returns:
the query collator, or null if one has not been specified for this query expression.

toString

protected void toString(java.lang.StringBuffer buf)
Description copied from class: QueryExpression
Get a string representation for this query expression.

Specified by:
toString in class QueryExpression
Parameters:
buf - a string buffer the string representation should be appended to.


Copyright © 2008. All Rights Reserved.