org.opends.server.schema
Class IntegerOrderingMatchingRule

java.lang.Object
  extended by org.opends.server.api.MatchingRule<OrderingMatchingRuleCfg>
      extended by org.opends.server.api.OrderingMatchingRule
          extended by org.opends.server.schema.IntegerOrderingMatchingRule
All Implemented Interfaces:
java.io.Serializable, java.util.Comparator<byte[]>

public class IntegerOrderingMatchingRule
extends OrderingMatchingRule

This class defines the integerOrderingMatch matching rule defined in X.520 and referenced in RFC 4519.

See Also:
Serialized Form

Constructor Summary
IntegerOrderingMatchingRule()
          Creates a new instance of this integerOrderingMatch matching rule.
 
Method Summary
 int compare(byte[] b1, byte[] b2)
          Compares the contents of the provided byte arrays to determine their relative order.
 int compareValues(ByteString value1, ByteString value2)
          Compares the first value to the second and returns a value that indicates their relative order.
 java.lang.String getDescription()
          Retrieves the description for this matching rule.
 java.lang.String getName()
          Retrieves the common name for this matching rule.
 java.lang.String getOID()
          Retrieves the OID for this matching rule.
 java.lang.String getSyntaxOID()
          Retrieves the OID of the syntax with which this matching rule is associated.
 void initializeMatchingRule(OrderingMatchingRuleCfg configuration)
          Initializes this matching rule based on the information in the provided configuration entry.
 ByteString normalizeValue(ByteString value)
          Retrieves the normalized form of the provided value, which is best suited for efficiently performing matching operations on that value.
 
Methods inherited from class org.opends.server.api.OrderingMatchingRule
valuesMatch
 
Methods inherited from class org.opends.server.api.MatchingRule
equals, finalizeMatchingRule, getNameOrOID, hashCode, isConfigurationAcceptable, isObsolete, toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

IntegerOrderingMatchingRule

public IntegerOrderingMatchingRule()
Creates a new instance of this integerOrderingMatch matching rule.

Method Detail

initializeMatchingRule

public void initializeMatchingRule(OrderingMatchingRuleCfg configuration)
                            throws ConfigException,
                                   InitializationException
Initializes this matching rule based on the information in the provided configuration entry.

Specified by:
initializeMatchingRule in class MatchingRule<OrderingMatchingRuleCfg>
Parameters:
configuration - The configuration to use to intialize this matching rule.
Throws:
ConfigException - If an unrecoverable problem arises in the process of performing the initialization.
InitializationException - If a problem that is not configuration-related occurs during initialization.

getName

public java.lang.String getName()
Retrieves the common name for this matching rule.

Specified by:
getName in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
The common name for this matching rule, or null if it does not have a name.

getOID

public java.lang.String getOID()
Retrieves the OID for this matching rule.

Specified by:
getOID in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
The OID for this matching rule.

getDescription

public java.lang.String getDescription()
Retrieves the description for this matching rule.

Specified by:
getDescription in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
The description for this matching rule, or null if there is none.

getSyntaxOID

public java.lang.String getSyntaxOID()
Retrieves the OID of the syntax with which this matching rule is associated.

Specified by:
getSyntaxOID in class MatchingRule<OrderingMatchingRuleCfg>
Returns:
The OID of the syntax with which this matching rule is associated.

normalizeValue

public ByteString normalizeValue(ByteString value)
                          throws DirectoryException
Retrieves the normalized form of the provided value, which is best suited for efficiently performing matching operations on that value.

Specified by:
normalizeValue in class MatchingRule<OrderingMatchingRuleCfg>
Parameters:
value - The value to be normalized.
Returns:
The normalized version of the provided value.
Throws:
DirectoryException - If the provided value is invalid according to the associated attribute syntax.

compareValues

public int compareValues(ByteString value1,
                         ByteString value2)
Compares the first value to the second and returns a value that indicates their relative order.

Specified by:
compareValues in class OrderingMatchingRule
Parameters:
value1 - The normalized form of the first value to compare.
value2 - The normalized form of the second value to compare.
Returns:
A negative integer if value1 should come before value2 in ascending order, a positive integer if value1 should come after value2 in ascending order, or zero if there is no difference between the values with regard to ordering.

compare

public int compare(byte[] b1,
                   byte[] b2)
Compares the contents of the provided byte arrays to determine their relative order.

Parameters:
b1 - The first byte array to use in the comparison.
b2 - The second byte array to use in the comparison.
Returns:
A negative integer if b1 should come before b2 in ascending order, a positive integer if b1 should come after b2 in ascending order, or zero if there is no difference between the values with regard to ordering.