OCDM_AnnotationSet Class Reference

As the name implies this class incorporates every function related to the manipulation of Annotation sets.

#include <OCDM.h>

Inheritance diagram for OCDM_AnnotationSet:

OCDM_Object List of all members.

Public Member Functions

 OCDM_AnnotationSet ()
 OCDM_AnnotationSet (const CDM_Object obj)
 OCDM_AnnotationSet (const class OCDM_AnnotationSet &obj)
OCDM_AnnotationSetoperator= (const class OCDM_Object &obj)
 This is the default assignment operator.
 OCDM_INDEX_OPERATOR_REF (OCDM_Annotation) operator[](const long index) const
void AddAnnotation (const OCDM_Annotation &Ann)
 This function will add the given Annotation (specified by the "Ann" parameter) into the Annotation set object in use.
int CompareAnnotations (const OCDM_Annotation &Ann1, const OCDM_Annotation &Ann2) const
 This function will compare two Annotations, Ann1 and Ann2, according to their Span sets.
void MergeAnnotations (OCDM_AnnotationSet &AnnSet)
 The goal of this function is to concatenate the Annotation set object in use with the object having being defined in the parameter AnnSet.
 OCDM_REF (OCDM_AnnotationSet) AnnotationsAt(const long position) const
 OCDM_REF (OCDM_AnnotationSet) AnnotationsContaining(const long position) const
 OCDM_REF (OCDM_AnnotationSet) AnnotationsContaining(const long position1
 OCDM_REF (OCDM_AnnotationSet) AnnotationsInRange(const long Start
 OCDM_REF (OCDM_AnnotationSet) AnnotationsInRange(const OCDM_Annotation &Ann) const
 OCDM_REF (OCDM_AnnotationSet) AnnotationsMatchingRange(long Start
 OCDM_REF (OCDM_AnnotationSet) AnnotationsMatchingRange(const OCDM_Annotation &Ann) const
 OCDM_REF (OCDM_Annotation) FirstAnnotationContaining(const long Position) const
 OCDM_REF (OCDM_Annotation) FirstAnnotationContaining(const long Position1
 OCDM_REF (OCDM_Annotation) GetAnnotation(const long Id) const
void RemoveAnnotation (const long Id)
 This function will remove the Annotation object that has as Id the value specified by the "Id" parameter from the Annotation set object we are currently use.
 OCDM_REF (OCDM_AnnotationSet) SelectAnnotations(const char *Type) const
 OCDM_REF (OCDM_AnnotationSet) SelectAnnotations(const char *Type
 OCDM_REF (OCDM_AnnotationSet) SelectAnnotationsSorted(const char *Type) const
 OCDM_REF (OCDM_AnnotationSet) SelectAnnotationsSorted(const char *Type
void SortAnnotationSet (void)
 This function will sort all the annotations, contained in the Annotation Set object in use, according to their span ranges.
void DisplaceAnnotations (const long offset, const long displacement)
 This function displases or "moves" the Annotations of the Annotation set object in use by "displacement" characters.
 OCDM_REF (OCDM_AnnotationSet) NextAnnotations(const long Position) const
const char * objectType (void) const

Public Attributes

const long position2 const
const long End const
long End const
const long Position2 const
const char *Constraints const
const char *Constraints const

Constructor & Destructor Documentation

OCDM_AnnotationSet  )  [inline]
 

OCDM_AnnotationSet const CDM_Object  obj  )  [inline]
 

OCDM_AnnotationSet const class OCDM_AnnotationSet obj  )  [inline]
 


Member Function Documentation

void AddAnnotation const OCDM_Annotation Ann  ) 
 

Description:
This function will add the given Annotation (specified by the "Ann" parameter) into the Annotation set object in use. This function (unlike OCDM_AddAnnotation for Documents) will not modify in any way the Id of the provided Annotation: it is the responsibility of the caller to set a proper Id to the provided Annotation. The Annotation object will be appended to the Annotation set even if it does not have an Id (Id = -1). This function will simply append the provided Annotation object to the provided Annotation set. It will not check if an Annotation with the same Id already exists in order to replace it, as OCDM_AddAnnotation will do when it is applied on a Document object.
Arguments:
  • Ann: The name of the annotation to be added.

int CompareAnnotations const OCDM_Annotation Ann1,
const OCDM_Annotation Ann2
const
 

Arguments:
  • Ann1: The first annotation to be compared.
  • Ann2: The second annotation to be compared according to their span set
Returns:
This function returns -1 if Ann1 is lower than Ann2, i.e. Ann1 spans a text range that starts earlier than all the text ranges spanned by the Ann2 Annotation. If the two Annotations span the same text ranges, zero is returned. Finally, 1 is returned if Ann1 is greater than Ann2, i.e. when Ann2 spans a text range starts earlier than all the text ranges spanned by the Ann1 Annotation.
Note:
In case of an error, an Exception of type OCDM_Exception will be thrown and an error message will be left at the current Tcl interpreter (CDM_Interp).

void DisplaceAnnotations const long  offset,
const long  displacement
 

Description:
This function displases or "moves" the Annotations of the Annotation set object in use by "displacement" characters. This function will iterate over all Annotations contained in the Annotation set. For each Annotation, all spans contained in the span set will be examined: for each offset in the span (either start or end), if it is equal or greater than the value provided by the "offset" parameter, then the value of the "displacement" parameter will be added.
Note:
In case of an error, an Exception of type OCDM_Exception will be thrown

void MergeAnnotations OCDM_AnnotationSet AnnSet  ) 
 

Arguments:
  • AnnSet: The name of the annotation to be concatenated.
Note:
In case of an error, an OCDM_Exception will be thrownn and an error message will be left at the current active interpeter (CDM_Interp).

const char* objectType void   )  const [inline, virtual]
 

This method returns the type of the object as a string.

Reimplemented from OCDM_Object.

OCDM_INDEX_OPERATOR_REF OCDM_Annotation   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_Annotation   )  const
 

OCDM_REF OCDM_Annotation   )  const
 

OCDM_REF OCDM_Annotation   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   ) 
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

OCDM_REF OCDM_AnnotationSet   )  const
 

class OCDM_AnnotationSet& operator= const class OCDM_Object obj  )  [inline, virtual]
 

Description: This is the default sssignment operator. Note that under
languages that do not support operator overloading (i.e. Java, Perl, Python) this operator appears as a plain method named as "set".
Arguments:
  • obj: the object to be copied.
Returns:
This method returns a reference to the current object.

Reimplemented from OCDM_Object.

void RemoveAnnotation const long  Id  ) 
 

Arguments:
  • Id: The id of the annotation to be removed
Note:
If the provided Annotation set does not contain an Annotation with the specified Id, an Exception of tpe OCDM_Exception will be thrown signing an error.

void SortAnnotationSet void   ) 
 

For more information about the sorting order, please refer to the CompareAnnotations function.

In case of an error, an Exception of type OCDM_Exception will be thrown


Member Data Documentation

const char* Constraints const
 

const char* Constraints const
 

const long Position2 const
 

long End const
 

const long End const
 

const long position2 const
 


Generated on Wed Aug 16 22:32:02 2006 for PythonCDM by  doxygen 1.4.6