org.modeshape.jcr.spi.index.provider

## Interface Costable

- All Known Subinterfaces:
    LocalIndex<T>, ManagedIndex
  All Known Implementing Classes:
    ManagedLocalIndex

      public interface Costable

  A simple interface that provides metrics needed to compute the cost of applying indexes.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `estimateCardinality(Constraint constraint, Map<String,Object> variables)` Compute the cost applying the given constraint.
    `long` | `estimateTotalCount()` Get the estimated number of entries within this index.

- - ### Method Detail

    - #### estimateCardinality

          long estimateCardinality(Constraint constraint,
                                 Map<String,Object> variables)

      Compute the cost applying the given constraint.
      Parameters:
        `constraint` - the constraint; never null
        `variables` - the bound variables for the query that is being costed; never null
      Returns:
        the approximate number of records that will be returned

    - #### estimateTotalCount

          long estimateTotalCount()

      Get the estimated number of entries within this index.
      Returns:
        the number of entries, or -1 if not known

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