org.opends.server.api
Class ApproximateMatchingRule

java.lang.Object
  extended by org.opends.server.api.MatchingRule<ApproximateMatchingRuleCfg>
      extended by org.opends.server.api.ApproximateMatchingRule
Direct Known Subclasses:
DoubleMetaphoneApproximateMatchingRule

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=false)
public abstract class ApproximateMatchingRule
extends MatchingRule<ApproximateMatchingRuleCfg>

This class defines the set of methods and structures that must be implemented by a Directory Server module that implements a matching rule used for approximate matching.


Constructor Summary
ApproximateMatchingRule()
           
 
Method Summary
abstract  boolean approximatelyMatch(ByteString value1, ByteString value2)
          Indicates whether the two provided normalized values are approximately equal to each other.
 ConditionResult valuesMatch(ByteString attributeValue, ByteString assertionValue)
          Indicates whether the provided attribute value should be considered a match for the given assertion value.
 
Methods inherited from class org.opends.server.api.MatchingRule
equals, finalizeMatchingRule, getDescription, getName, getNameOrOID, getOID, getSyntaxOID, hashCode, initializeMatchingRule, isConfigurationAcceptable, isObsolete, normalizeValue, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApproximateMatchingRule

public ApproximateMatchingRule()
Method Detail

approximatelyMatch

public abstract boolean approximatelyMatch(ByteString value1,
                                           ByteString value2)
Indicates whether the two provided normalized values are approximately equal to each other.

Parameters:
value1 - The normalized form of the first value to compare.
value2 - The normalized form of the second value to compare.
Returns:
true if the provided values are approximately equal, or false if not.

valuesMatch

public ConditionResult valuesMatch(ByteString attributeValue,
                                   ByteString assertionValue)
Indicates whether the provided attribute value should be considered a match for the given assertion value. This will only be used for the purpose of extensible matching. Other forms of matching against approximate matching rules should use the areEqual method.

Specified by:
valuesMatch in class MatchingRule<ApproximateMatchingRuleCfg>
Parameters:
attributeValue - The attribute value in a form that has been normalized according to this matching rule.
assertionValue - The assertion value in a form that has been normalized according to this matching rule.
Returns:
TRUE if the attribute value should be considered a match for the provided assertion value, FALSE if it does not match, or UNDEFINED if the result is undefined.