Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

AnnotationIndex Class Reference

#include <AnnotationIndex.h>

Collaboration diagram for AnnotationIndex:

Collaboration graph
[legend]
List of all members.

Public Methods

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

 ~AnnotationIndex ()
 A destructor. More...

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

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

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

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

AnnotationSet getByOffset (Offset offset)
AnnotationgetAnnotationByOffset (Offset offset)
bool existsAnnotation (const Id &id)
 Test if the specified annotation exists. More...

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

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


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(s):
Xiaoyi Ma, Steven Bird


Constructor & Destructor Documentation

AnnotationIndex::AnnotationIndex ( )
 

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

AnnotationIndex::~AnnotationIndex ( )
 

A destructor.


Member Function Documentation

void AnnotationIndex::add ( Annotation * a )
 

add an annotation to the indexes.

void AnnotationIndex::addFeature ( Annotation * a,
const String & feature,
const String & value )
 

add a feature to the indexes.

void AnnotationIndex::deleteAnnotation ( Annotation * a )
 

delete an annotation from the indexes.

void AnnotationIndex::deleteFeature ( Annotation * a,
const String & feature )
 

delete a feature from the indexes.

bool AnnotationIndex::existsAnchor ( const Id & id )
 

Test if the specified anchor exists.

bool AnnotationIndex::existsAnnotation ( const Id & id )
 

Test if the specified annotation exists.

Annotation * AnnotationIndex::getAnnotationByOffset ( Offset offset )
 

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.

Offset AnnotationIndex::getNearestOffset ( Offset o )
 

get the nearest used offset to the specified offset.


Friends And Related Function Documentation

class AG [friend]
 


The documentation for this class was generated from the following file:
Generated at Wed Jul 3 14:55:15 2002 for Annotation Graph API by doxygen1.2.7 written by Dimitri van Heesch, © 1997-2001