Main Page   Class Hierarchy   Compound List   Compound Members  

AnnotationIndex Class Reference

List of all members.

Public Methods

 AnnotationIndex ()
 A constructor. Create an AnnotationIndex with an empty set of indexes.

 ~AnnotationIndex ()
 A destructor.

void add (Annotation *a)
 add an annotation to the indexes

void deleteAnnotation (Annotation *a)
 delete an annotation from the indexes

void addFeature (Annotation *a, const String &feature, const String &value)
 add a feature to the indexes

void deleteFeature (Annotation *a, const String &feature)
 delete a feature from the indexes

AnnotationSet getByOffset (Offset offset)
AnnotationgetAnnotationByOffset (Offset offset, const AnnotationType &type="")
bool existsAnnotation (const Id &id)
 Test if the specified annotation exists.

bool existsAnchor (const Id &id)
 Test if the specified anchor exists.

Offset getNearestOffset (Offset o)
 get the nearest used offset to the specified offset


Detailed Description

AnnotationIndex manages the indexes over anchors and annotations within an AG. Anchors are indexed by their id and offset. Annotations are indexed by their id, type, feature, start anchor, end anchor, start anchor offset and end anchor offset.
Author:
Xiaoyi Ma, Steven Bird


Member Function Documentation

Annotation* AnnotationIndex::getAnnotationByOffset Offset    offset,
const AnnotationType &    type = ""
 

Get one of the annotations which overlap a particular time offset. Same as getByOffset except that getAnnotationByOffset returns only one qualified annotation while getByOffset returns all of them. getAnnotationByOffset is signaficantly faster than getByOffset. Should be favored over getByOffset whenever possible.

See also:
getByOffset

AnnotationSet AnnotationIndex::getByOffset Offset    offset
 

Get the annotations that overlap a particular time offset. Get all annotations whose start anchor offset is smaller than or equal to the given offset AND end anchor offset is greater than or equal to the given offet.