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 Propertys of GCubeElements.

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 Readers;

Constraints take accordingly two forms: 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 Predicates.

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.