org.modeshape.jcr.index.local

## Interface IndexValues.Converter<T>

- Type Parameters:
    `T` - the index's key type
  All Known Implementing Classes:
    IndexValues.StandardConverter
  Enclosing class:
    IndexValues

      public static interface IndexValues.Converter<T>

  Converts between `StaticOperand` and an index's key type.

  Note that `IndexDefinition.IndexKind.VALUE` indexes may have multiple node keys for a given value, which means that any given value might have a range of keys. Some MapDB-based indexes store such entries using an index key that consists of the actual property value plus a counter. In this way, there are multiple index keys for a given `StaticOperand`, and the `toLowerValue(javax.jcr.query.qom.StaticOperand, java.util.Map<java.lang.String, java.lang.Object>)` will return the lowest-possible index key given the `StaticOperand`, while the `toUpperValue(javax.jcr.query.qom.StaticOperand, java.util.Map<java.lang.String, java.lang.Object>)` will return the highest-possible index key for the given `StaticOperand`

  `IndexDefinition.IndexKind.UNIQUE_VALUE` indexes will use the actual property value as the index key, and thus the `toLowerValue(javax.jcr.query.qom.StaticOperand, java.util.Map<java.lang.String, java.lang.Object>)` and `toUpperValue(javax.jcr.query.qom.StaticOperand, java.util.Map<java.lang.String, java.lang.Object>)` methods will both return the same index key for the same `StaticOperand`.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `toLowerValue(StaticOperand operand, Map<String,Object> variables)` Create the lowest possible index key for the supplied `StaticOperand`.
    `T` | `toUpperValue(StaticOperand operand, Map<String,Object> variables)` Create the highest possible index key for the supplied `StaticOperand`.

- - ### Method Detail

    - #### toLowerValue

          T toLowerValue(StaticOperand operand,
                       Map<String,Object> variables)

      Create the lowest possible index key for the supplied `StaticOperand`.
      Parameters:
        `operand` - the static operand; may be null
        `variables` - the bound variables; may not be null but may be empty
      Returns:
        the lowest/smallest possible index key; or null if the operand is null

    - #### toUpperValue

          T toUpperValue(StaticOperand operand,
                       Map<String,Object> variables)

      Create the highest possible index key for the supplied `StaticOperand`.
      Parameters:
        `operand` - the static operand; may be null
        `variables` - the bound variables; may not be null but may be empty
      Returns:
        the highest/largest possible index key; or null if the operand is null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.