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

AG Class Reference

#include <AG.h>

Inheritance diagram for AG:

Inheritance graph
[legend]
Collaboration diagram for AG:

Collaboration graph
[legend]
List of all members.

Public Methods

 AG (Id id, Timeline *timeline=NULL, string type="")
 A constructor. More...

 ~AG ()
 A destructor. More...

Id getId () const
 Get the id of the AG. More...

void setType (string type)
 Set Type. More...

string getType () const
 Get Type. More...

TimelinegetTimeline () const
 Get Timeline. More...

void addAnchor (Anchor *a)
 Add an anchor. More...

void deleteAnchor (Anchor *a) throw (AGException)
 Delete an anchor. More...

void setAnchorOffset (Anchor *, Offset)
 Set an anchor's offset to the specified value. More...

AnchorsplitAnchor (Anchor *original)
void add (Annotation *anchor)
 Add a new annotation to the AG. More...

Id createAnnotation (Id id, Anchor *anchor1, Anchor *anchor2, AnnotationType annotationType) throw (AGException)
void setFeature (Id id, FeatureName featureName, FeatureValue featureValue)
bool existsFeature (Id id, FeatureName featureName)
void deleteFeature (Id id, FeatureName featureName)
string getFeature (Id id, FeatureName featureName)
StringSet getFeatureNames (Id id)
void getAnnotationFeatureNames (StringSet &S)
void getAnnotationTypes (StringSet &S)
void setFeatures (Id id, Features features)
Features getFeatures (Id id)
void unsetFeatures (Id id)
AnchorId createAnchor (Id id, Offset offset, Unit unit, string signals)
AnchorId createAnchor (Id id, Unit unit, string signals)
Offset getAnchorOffset (Anchor *anchor)
 Get the offset of the specified anchor. More...

AnnotationcopyAnnotation (const Annotation *annotation)
AnnotationsplitAnnotation (Annotation *original)
AnnotationSet nSplitAnnotation (Annotation *original, int n)
void deleteAnnotation (Annotation *annotation)
 Delete the annotation from the AG. More...

void setStartAnchor (Annotation *annotation, Anchor *anchor)
 Set the start anchor of an annotation to the specified anchor. More...

void setEndAnchor (Annotation *annotation, Anchor *anchor)
 Set the end anchor of an annotation to the specified anchor. More...

void unsetAnchorOffset (Anchor *a)
 Unset the offset of the specified anchor. More...

void setFeature (Annotation *, const String &, const String &)
 Set the specified feature of the annotation to this value. More...

AnchorSeqgetAnchorSet ()
 Get the set of anchors, sorted by offsets. More...

AnnotationgetById (const Id &id) throw (AGException)
 Get the annotation reference by its id. More...

AnchorgetAnchorById (const Id &id) throw (AGException)
 Get the anchor reference by its id. More...

AnchorSet getAnchorSetByOffset (Offset offset, double epsilon=0.0)
 Get anchors with the specified offset. More...

AnnotationSet getAnnotationSetByType (const String &t)
 Get the annotations of type t. More...

AnnotationSet getAnnotationSetByOffset (Offset o)
AnnotationSet getAnnotationSetByFeature (const String &f, const String &v)
 Get the annotations with value of feature f equals to v. More...

AnnotationSet getIncomingAnnotationSet (Anchor *a)
 Get the incoming annotations to the specified node. More...

AnnotationSet getIncomingAnnotationSetByType (Anchor *a, AnnotationType t)
 Get the incoming annotations of this type to the specified node. More...

AnnotationSet getOutgoingAnnotationSet (Anchor *a)
 Get the outgoing annotations from the specified node. More...

AnnotationSet getOutgoingAnnotationSetByType (Anchor *a, AnnotationType t)
 Get the outgoing annotations of this type from the specified node. More...

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

AnnotationSeq getAnnotationSeqByOffset (Offset begin=0.0, Offset end=0.0)
AnnotationgetAnnotationByOffset (Offset offset)
AnchorSet getAnchorSetNearestOffset (Offset offset)
 Get all anchors whose offset is the nearest to the specified offset. More...

list<string> storeSQLs (AGSetId agSetId, FeatureNameSet features)
 Create list of SQLs used to save the metadata to the DB server. More...

string toString ()
 Dump the AG in AIF format. More...


Detailed Description

An AG (Annotation Graph) is a set of annotations along with the index structure.
Author(s):
Xiaoyi Ma
Note:
that operations on anchors are private - these are used only by the class itself when building an annotation


Constructor & Destructor Documentation

AG::AG ( Id id,
Timeline * timeline = NULL,
string type = "" )
 

A constructor.

AG::~AG ( )
 

A destructor.


Member Function Documentation

void AG::add ( Annotation * anchor )
 

Add a new annotation to the AG.

void AG::addAnchor ( Anchor * a )
 

Add an anchor.

Annotation * AG::copyAnnotation ( const Annotation * annotation )
 

Clone an annotation. Make a copy of the specified annotation, assign the new annotation a new AnnotationId.

Parameters:
annotation   the original annotation
Returns:
the pointer to the clone

AnchorId AG::createAnchor ( Id id,
Unit unit,
string signals )
 

Create an anchor with specified unit and signals.

Parameters:
id   might be AGId or AnchorId. If id is a AGId, an AnchorId will be assigned the new anchor. If id is a AnchorId, it will try the given id first, if it's taken, assign a new AnchorId.
Returns:
AnchorId of the new anchor.
Exceptions:
AGException   IF (the id given is invalid)

AnchorId AG::createAnchor ( Id id,
Offset offset,
Unit unit,
string signals )
 

Create an anchor with specified offset, unit and signals.

Parameters:
id   might be AGId or AnchorId. If id is a AGId, an AnchorId will be assigned the new anchor. If id is a AnchorId, it will try the given id first, if it's taken, assign a new AnchorId.
Returns:
AnchorId of the new anchor.
Exceptions:
AGException   IF (the id given is invalid)

Id AG::createAnnotation ( Id id,
Anchor * anchor1,
Anchor * anchor2,
AnnotationType annotationType ) throw (AGException)
 

Create a new annotation.

Parameters:
id   might be AGId or AnnotationId. If id is an AGId, an AnnotationId will be assigned to the new annotation. If id is an AnnotationId, it will try the given id first, if it's taken, assign a new AnnotationId.
Returns:
the AnnotationId of the new annotation.
Exceptions:
AGException   IF (the id given is invalid)

void AG::deleteAnchor ( Anchor * a ) throw (AGException)
 

Delete an anchor.

void AG::deleteAnnotation ( Annotation * annotation )
 

Delete the annotation from the AG.

void AG::deleteFeature ( Id id,
FeatureName featureName )
 

Delete the specified feature from the metadata or annotation.

Parameters:
id   could be AGId or AnnotationId. If it is AGId, then delete the feature from the metadata of the AG. Or, if it is AnnotationId, delete the feature from the annotation.

bool AG::existsFeature ( Id id,
FeatureName featureName )
 

Test if a feature exists in the metadata or annotation.

Parameters:
id   could be AGId or AnnotationId. If it is AGId, then test the existence of the feature of the metadata of the AG. Or, if it is AnnotationId, test the existence of the feature of the annotation.

Anchor * AG::getAnchorById ( const Id & id ) throw (AGException)
 

Get the anchor reference by its id.

Offset AG::getAnchorOffset ( Anchor * anchor )
 

Get the offset of the specified anchor.

AnchorSeq * AG::getAnchorSet ( ) [inline]
 

Get the set of anchors, sorted by offsets.

AnchorSet AG::getAnchorSetByOffset ( Offset offset,
double epsilon = 0.0 )
 

Get anchors with the specified offset.

AnchorSet AG::getAnchorSetNearestOffset ( Offset offset )
 

Get all anchors whose offset is the nearest to the specified offset.

Annotation * AG::getAnnotationByOffset ( Offset offset ) [inline]
 

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 getAnnotationSetByOffset whenever possible.

See also:
getAnnotationSetByOffset

void AG::getAnnotationFeatureNames ( StringSet & S )
 

Get all feature names of all annotations in this AG.

Parameters:
S   The container for this method to put the results. Note that this method doesn't clean S before it puts the results.

AnnotationSeq AG::getAnnotationSeqByOffset ( Offset begin = 0.0,
Offset end = 0.0 )
 

Get all annotations with its start anchor offset in between the specified values. Get all annotations with its start anchor offset in between the specified values. If both values are 0, return all annotations in the AG.

Parameters:
begin, the   lower bound, default is 0.0.
end, the   upper bound, default is 0.0.
Returns:
all qualified annotations, sorted by start anchor offset.

AnnotationSet AG::getAnnotationSetByFeature ( const String & f,
const String & v ) [inline]
 

Get the annotations with value of feature f equals to v.

AnnotationSet AG::getAnnotationSetByOffset ( Offset o ) [inline]
 

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.

AnnotationSet AG::getAnnotationSetByType ( const String & t ) [inline]
 

Get the annotations of type t.

void AG::getAnnotationTypes ( StringSet & S )
 

Get types of all annotations in this AG.

Parameters:
S   The container for this method to put the results. Note that this method doesn't clean S before it puts the results.

Annotation * AG::getById ( const Id & id ) throw (AGException)
 

Get the annotation reference by its id.

string AG::getFeature ( Id id,
FeatureName featureName )
 

Get the value of specified feature in the metadata or annotation.

Parameters:
id   could be AGId or AnnotationId. If it is AGId, then get the value of specified feature from the metadata of the AG. Or, if it is AnnotationId, get the value of specified feature from the annotation.

StringSet AG::getFeatureNames ( Id id )
 

Get all feature names from the metadata or annotation.

Parameters:
id   could be AGId or AnnotationId. If it is AGId, then get all feature names from the metadata of the AG. Or, if it is AnnotationId, get all feature names from the annotation.
Returns:
string set which contains all the feature names

Features AG::getFeatures ( Id id )
 

Get all the features. returns all features in a single string in Dublin Core Structured Values DCSV (Cox & Iannella) format. For example, "name=Stone Philips;phone=(215)555-8888;age=40"

Note:
see http://dublincore.org/documents/2000/07/28/dcmi-dcsv/ for details about DCSV format.

Id AG::getId ( ) const [inline]
 

Get the id of the AG.

AnnotationSet AG::getIncomingAnnotationSet ( Anchor * a ) [inline]
 

Get the incoming annotations to the specified node.

AnnotationSet AG::getIncomingAnnotationSetByType ( Anchor * a,
AnnotationType t )
 

Get the incoming annotations of this type to the specified node.

Offset AG::getNearestOffset ( Offset o ) [inline]
 

Get the nearest used offset to the specified offset.

AnnotationSet AG::getOutgoingAnnotationSet ( Anchor * a ) [inline]
 

Get the outgoing annotations from the specified node.

AnnotationSet AG::getOutgoingAnnotationSetByType ( Anchor * a,
AnnotationType t )
 

Get the outgoing annotations of this type from the specified node.

Timeline * AG::getTimeline ( ) const [inline]
 

Get Timeline.

string AG::getType ( ) const [inline]
 

Get Type.

AnnotationSet AG::nSplitAnnotation ( Annotation * original,
int n )
 

Split an annotation to n annotations. A version of split which does the split operation n-1 times, i.e. split the original annotation into n annotations.

Parameters:
original, the   annotation to be split.
n   an integer specifying the number of annotations to split into.
Returns:
the set of new annotations, including the original one.
See also:
splitAnnotation

void AG::setAnchorOffset ( Anchor *,
Offset )
 

Set an anchor's offset to the specified value.

void AG::setEndAnchor ( Annotation * annotation,
Anchor * anchor )
 

Set the end anchor of an annotation to the specified anchor.

void AG::setFeature ( Annotation *,
const String &,
const String & )
 

Set the specified feature of the annotation to this value.

void AG::setFeature ( Id id,
FeatureName featureName,
FeatureValue featureValue )
 

Set feature value of the metadata or annotation.

Parameters:
id   could be AGId or AnnotationId. If it is AGId, then set the feature value of the metadata of the AG. Or, if it is AnnotationId, set the feature value of the annotation.

void AG::setFeatures ( Id id,
Features features )
 

Set multiple features in a single string. Set multiple features in a single string in Dublin Core Structured Values DCSV (Cox & Iannella) format. For example, "name=Stone Philips;phone=(215)555-8888;age=40"

Note:
see http://dublincore.org/documents/2000/07/28/dcmi-dcsv/ for details about DCSV format.
id could be AGId or AnnotationId. If it is AGId, then set features of the metadata of the AG. Or, if it is AnnotationId, set features of the annotation.

void AG::setStartAnchor ( Annotation * annotation,
Anchor * anchor )
 

Set the start anchor of an annotation to the specified anchor.

void AG::setType ( string type ) [inline]
 

Set Type.

Anchor * AG::splitAnchor ( Anchor * original )
 

Split an anchor in two. Split an anchor a in two, creating a new anchor a' having the same offset as the original one. Anchor a has all the incoming annotations, while anchor a' has all the outgoing annotations. The new anchor a' is returned.

Annotation * AG::splitAnnotation ( Annotation * original )
 

Split an annotation a in two. Split an annotation a in two, creating a new annotation a' having the same label data as the original one. The two annotations a, a' connect head-to-tail at a new anchor. The new annotation and anchor have identifiers taken from the specified identifier spaces. The new anchor is unanchored, i.e. has no offset.

Parameters:
original, the   annotation to be split.
Returns:
a pointer to the new annotation a'.

list< string > AG::storeSQLs ( AGSetId agSetId,
FeatureNameSet features )
 

Create list of SQLs used to save the metadata to the DB server.

string AG::toString ( )
 

Dump the AG in AIF format.

void AG::unsetAnchorOffset ( Anchor * a )
 

Unset the offset of the specified anchor.

void AG::unsetFeatures ( Id id )
 

Unset all features in the metadata or annotation. Set all the features to empty string.

Parameters:
id   could be AGId or AnnotationId. If it is AGId, then unset features of the metadata of the AG. Or, if it is AnnotationId, unset features of the annotation.


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