Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.jcr.query.lucene
Class ComparePathQuery

    java.lang.Object
      org.apache.lucene.search.Query
          org.modeshape.jcr.query.lucene.CompareQuery<Path>
              org.modeshape.jcr.query.lucene.ComparePathQuery

All Implemented Interfaces:
  Serializable, Cloneable

    public class ComparePathQuery

extends CompareQuery<Path>

A Lucene `Query` implementation that is used to apply a `Comparison` constraint against the Path of nodes. This query implementation works by using the weight and `scorer` of the wrapped query to score (and return) only those documents that correspond to nodes with Paths that satisfy the constraint.

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.modeshape.jcr.query.lucene.CompareQuery
`CompareQuery.CompareScorer, CompareQuery.CompareWeight, CompareQuery.Evaluator<ValueType>`

Field Summary
`protected static CompareQuery.Evaluator<Path>` | `PATH_IS_GREATER_THAN`
`protected static CompareQuery.Evaluator<Path>` | `PATH_IS_GREATER_THAN_OR_EQUAL_TO`
`protected static CompareQuery.Evaluator<Path>` | `PATH_IS_LESS_THAN`
`protected static CompareQuery.Evaluator<Path>` | `PATH_IS_LESS_THAN_OR_EQUAL_TO`

Fields inherited from class org.modeshape.jcr.query.lucene.CompareQuery
`constraintValue, evaluator, fieldName, fieldSelector, stringFactory, valueTypeFactory`

Constructor Summary
`protected` | `ComparePathQuery(String fieldName, Path constraintPath, ValueFactory<Path> pathFactory, ValueFactory<String> stringFactory, CompareQuery.Evaluator<Path> evaluator, CaseOperations.CaseOperation caseOperation)` Construct a `Query` implementation that scores nodes according to the supplied comparator.

Method Summary
`Object` | `clone()`
`static ComparePathQuery` | `createQueryForNodesWithPathGreaterThan(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)` Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is greater than the supplied constraint path.
`static ComparePathQuery` | `createQueryForNodesWithPathGreaterThanOrEqualTo(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)` Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is greater than or equal to the supplied constraint path.
`static ComparePathQuery` | `createQueryForNodesWithPathLessThan(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)` Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is less than the supplied constraint path.
`static ComparePathQuery` | `createQueryForNodesWithPathLessThanOrEqualTo(Path constraintPath, String fieldName, ValueFactories factories, CaseOperations.CaseOperation caseOperation)` Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is less than or equal to the supplied constraint path.
`protected Path` | `readFromDocument(org.apache.lucene.index.IndexReader reader, int docId)`

Methods inherited from class org.modeshape.jcr.query.lucene.CompareQuery
`createWeight, toString`

Methods inherited from class org.apache.lucene.search.Query
`combine, equals, extractTerms, getBoost, getSimilarity, hashCode, mergeBooleanQueries, rewrite, setBoost, toString, weight`

Methods inherited from class java.lang.Object
`finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### PATH_IS_LESS_THAN

    protected static final CompareQuery.Evaluator<Path> PATH_IS_LESS_THAN

### PATH_IS_LESS_THAN_OR_EQUAL_TO

    protected static final CompareQuery.Evaluator<Path> PATH_IS_LESS_THAN_OR_EQUAL_TO

### PATH_IS_GREATER_THAN

    protected static final CompareQuery.Evaluator<Path> PATH_IS_GREATER_THAN

### PATH_IS_GREATER_THAN_OR_EQUAL_TO

    protected static final CompareQuery.Evaluator<Path> PATH_IS_GREATER_THAN_OR_EQUAL_TO

Constructor Detail

### ComparePathQuery

    protected ComparePathQuery(String fieldName,
                               Path constraintPath,
                               ValueFactory<Path> pathFactory,
                               ValueFactory<String> stringFactory,
                               CompareQuery.Evaluator<Path> evaluator,
                               CaseOperations.CaseOperation caseOperation)

  Construct a `Query` implementation that scores nodes according to the supplied comparator.

  Parameters:
    `fieldName` - the name of the document field containing the path value; may not be null
    `constraintPath` - the constraint path; may not be null
    `pathFactory` - the value factory that can be used during the scoring; may not be null
    `stringFactory` - the string factory that can be used during the scoring; may not be null
    `evaluator` - the `CompareQuery.Evaluator` implementation that returns whether the node path satisfies the constraint; may not be null
    `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null

Method Detail

### createQueryForNodesWithPathGreaterThan

    public static ComparePathQuery createQueryForNodesWithPathGreaterThan(Path constraintPath,
                                                                          String fieldName,
                                                                          ValueFactories factories,
                                                                          CaseOperations.CaseOperation caseOperation)

  Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is greater than the supplied constraint path.

  Parameters:
    `constraintPath` - the constraint path; may not be null
    `fieldName` - the name of the document field containing the path value; may not be null
    `factories` - the value factories that can be used during the scoring; may not be null
    `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
  Returns:
    the path query; never null

### createQueryForNodesWithPathGreaterThanOrEqualTo

    public static ComparePathQuery createQueryForNodesWithPathGreaterThanOrEqualTo(Path constraintPath,
                                                                                   String fieldName,
                                                                                   ValueFactories factories,
                                                                                   CaseOperations.CaseOperation caseOperation)

  Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is greater than or equal to the supplied constraint path.

  Parameters:
    `constraintPath` - the constraint path; may not be null
    `fieldName` - the name of the document field containing the path value; may not be null
    `factories` - the value factories that can be used during the scoring; may not be null
    `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
  Returns:
    the path query; never null

### createQueryForNodesWithPathLessThan

    public static ComparePathQuery createQueryForNodesWithPathLessThan(Path constraintPath,
                                                                       String fieldName,
                                                                       ValueFactories factories,
                                                                       CaseOperations.CaseOperation caseOperation)

  Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is less than the supplied constraint path.

  Parameters:
    `constraintPath` - the constraint path; may not be null
    `fieldName` - the name of the document field containing the path value; may not be null
    `factories` - the value factories that can be used during the scoring; may not be null
    `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
  Returns:
    the path query; never null

### createQueryForNodesWithPathLessThanOrEqualTo

    public static ComparePathQuery createQueryForNodesWithPathLessThanOrEqualTo(Path constraintPath,
                                                                                String fieldName,
                                                                                ValueFactories factories,
                                                                                CaseOperations.CaseOperation caseOperation)

  Construct a `Query` implementation that scores documents such that the node represented by the document has a path that is less than or equal to the supplied constraint path.

  Parameters:
    `constraintPath` - the constraint path; may not be null
    `fieldName` - the name of the document field containing the path value; may not be null
    `factories` - the value factories that can be used during the scoring; may not be null
    `caseOperation` - the operation that should be performed on the indexed values before the constraint value is being evaluated; may not be null
  Returns:
    the path query; never null

### readFromDocument

    protected Path readFromDocument(org.apache.lucene.index.IndexReader reader,
                                    int docId)
                             throws IOException

  Overrides:
    `readFromDocument` in class `CompareQuery<Path>`
  Throws:
    `IOException`

### clone

    public Object clone()

  Overrides:
    `clone` in class `org.apache.lucene.search.Query`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha6
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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