org.modeshape.jcr.api.index

## Interface IndexDefinition

- All Superinterfaces:
    Iterable<IndexColumnDefinition>
  All Known Subinterfaces:
    IndexDefinitionTemplate

      public interface IndexDefinition
      extends Iterable<IndexColumnDefinition>

  An immutable description of an index definition.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `IndexDefinition.IndexKind` The kind of indexes.
    `static interface` | `IndexDefinition.WorkspaceMatchRule`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `appliesToProperty(String propertyName)` Determine if this index definition has a column that applies to the named property.
    `IndexColumnDefinition` | `getColumnDefinition(int position)` Get the definition for the index column at the given 0-based position.
    `String` | `getDescription()` Get the description of this index.
    `Map<String,Object>` | `getIndexProperties()` Get the index property values keyed by their name.
    `Object` | `getIndexProperty(String propertyName)` Get the index property with the given name.
    `IndexDefinition.IndexKind` | `getKind()` Get the kind of index.
    `String` | `getName()` Get the name of this index.
    `String` | `getNodeTypeName()` Get the name of the node type for which this index applies.
    `String` | `getProviderName()` Get the name of the provider that owns this index.
    `IndexDefinition.WorkspaceMatchRule` | `getWorkspaceMatchRule()` Get the rule that defines the workspaces to which this index definition applies.
    `boolean` | `hasSingleColumn()` Determine whether this index has a single column.
    `boolean` | `isEnabled()` Determine whether this index is currently enabled.
    `boolean` | `isSynchronous()` Determine whether this index is updated synchronously.
    `int` | `size()` Get the number of columns in this index.

    - ### Methods inherited from interface java.lang.Iterable

      `iterator`

- - ### Method Detail

    - #### getName

          String getName()

      Get the name of this index.
      Returns:
        the name of this index; never null

    - #### getProviderName

          String getProviderName()

      Get the name of the provider that owns this index.
      Returns:
        the provider name; never null

    - #### getKind

          IndexDefinition.IndexKind getKind()

      Get the kind of index.
      Returns:
        the index kind; never null

    - #### getNodeTypeName

          String getNodeTypeName()

      Get the name of the node type for which this index applies.
      Returns:
        the node type name; never null

    - #### getDescription

          String getDescription()

      Get the description of this index.
      Returns:
        the description; never null

    - #### isEnabled

          boolean isEnabled()

      Determine whether this index is currently enabled.
      Returns:
        true if this index is enabled and active, or false if it is not currently being used

    - #### isSynchronous

          boolean isSynchronous()

      Determine whether this index is updated synchronously. If true, then its indexes are updated within the scope of the save operations. Otherwise, the indexes are updated asynchronously.
      Returns:
        true if the index is synchronously updated, or false otherwise

    - #### hasSingleColumn

          boolean hasSingleColumn()

      Determine whether this index has a single column.
      Returns:
        true if this index has a single column, or false if it has more

    - #### size

          int size()

      Get the number of columns in this index.
      Returns:
        the number of columns; always positive

    - #### getColumnDefinition

          IndexColumnDefinition getColumnDefinition(int position)
                                                    throws NoSuchElementException

      Get the definition for the index column at the given 0-based position.
      Parameters:
        `position` - the 0-based position; must be less than `size()`
      Returns:
        the index definition
      Throws:
        `NoSuchElementException` - if the position is negative or greater than or equal to `size()`.

    - #### getIndexProperty

          Object getIndexProperty(String propertyName)

      Get the index property with the given name. These properties are usually non-standard.
      Parameters:
        `propertyName` - the property name; may not be null
      Returns:
        the value or values of the property, or null if there is no property with that name

    - #### getIndexProperties

          Map<String,Object> getIndexProperties()

      Get the index property values keyed by their name. These properties are usually non-standard.
      Returns:
        the properties; never null but possibly empty

    - #### getWorkspaceMatchRule

          IndexDefinition.WorkspaceMatchRule getWorkspaceMatchRule()

      Get the rule that defines the workspaces to which this index definition applies.
      Returns:
        the matching rule for the workspace names; never null

    - #### appliesToProperty

          boolean appliesToProperty(String propertyName)

      Determine if this index definition has a column that applies to the named property. This is a convenience method that is equivalent to:

           for (IndexColumnDefinition columnDefn : this) {
               if (columnDefn.getPropertyName().equals(propertyName)) return true;
           }
           return false;

      Parameters:
        `propertyName` - the name of the property
      Returns:
        true if this definition contains a column that applies to a property with the given name

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