Projection
Date: 2013-06-18

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

## org.gcube.contentmanagement.gcubedocumentlibrary.projections
Interface Projection<E extends GCubeElement,P extends Property>

Type Parameters:
  `E` - the type of `GCubeElement`.
  `P` - the of `Property`.

All Known Implementing Classes:
  AlternativeProjection, AnnotationProjection, BaseProjection, DocumentProjection, MetadataProjection, PartProjection, PropertyProjection

    public interface Projection<E extends GCubeElement,P extends Property>

Encapsulates a set of constraints over the `Property`s of `GCubeElement`s.

Projections are used to match whole documents. This occurs when the properties of the `GCubeElement` associated with the projection satisfy its constraints. Projections and matching are used in the retrieval operations of `Reader`s;

- as a means to characterise relevant documents (projections as types)
- as a means to specify what parts of relevant documents should be retrieved (projections as retrieve directives).

Constraints take accordingly two forms:

- include constraints apply to properties that must be matched and retrieved.
- filter constraints apply to properties that must be matched but not retrieved.

For example, a projection may define an include constraint over the name of metadata elements and a filter constraint over the time of their last update. It may then be fed to a `Reader` in order to: (i) characterise documents with metadata elements that match both constraints, but to (ii)retrieve of those documents only the name of matching metadata elements, excluding other document properties, elements, or element properties.

Whether to include or filter, all constraints take the form of `Predicate`s.

Author:
  Fabio Simeoni (University of Strathclyde)

Method Summary
`java.util.Map<P,Predicate>` | `constraints()` Returns all the include and filter constraints of the projection.
`TreePredicate` | `documentPredicate()` Returns a `TreePredicate` that characterises documents which match the projection.
`TreePredicate` | `predicate()` Returns a `TreePredicate` that characterises elements that match the projection.

Method Detail

### constraints

    java.util.Map<P,Predicate> constraints()

  Returns all the include and filter constraints of the projection.

  Returns:
    the properties.

### documentPredicate

    TreePredicate documentPredicate()

  Returns a `TreePredicate` that characterises documents which match the projection.

  Returns:
    the predicate.

### predicate

    TreePredicate predicate()

  Returns a `TreePredicate` that characterises elements that match the projection.

  This method behaves like `documentPredicate()` if the projection is defined over documents. It differs if it is defined over inner elements.

  Returns:
    the predicate.

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