AnnotationCollection

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public final class AnnotationCollection implements Iterable<Annotation>

Class representing annotation collection.

Constructors

ConstructorDescription
AnnotationCollection(Page page)Constructor of AnnotationCollection.

Methods

MethodDescription
isSynchronized()Gets a value indicating whether access to the com.aspose.pdf.AnnotationCollection is synchronized (thread safe).
getSyncRoot()Gets an object that can be used to synchronize access to com.aspose.pdf.AnnotationCollection.
size()Gets count of annotations in collection.
isReadOnly()Gets a value indicating if collection is readonly.
add(Annotation annotation, boolean considerRotation)Adds annotation to the collection.
add(Annotation annotation)Adds annotation to the collection.
delete(int index)Deletes annotation from the collection by index.
delete()Deletes all annotations from the collection.
copyTo(Annotation[] array, int index)Copies array of annotations into collection.
iterator()Returns collection enumerator.
accept(AnnotationSelector visitor)Accepts visitor to process annotation.
delete(Annotation annotation)Deletes specified annotation from the collection.
clear()Deletes all annotations from the collection.
contains(Annotation annotation)Checks if specified annotation belong to collection.
remove(Annotation annotation)Deletes specified annotation from the collection.
get_Item(int index)The index of the element to get.
findByName(String name)Returns annotation by its name.

AnnotationCollection(Page page)

public AnnotationCollection(Page page)

Constructor of AnnotationCollection. Creates annotation collection for annotations on the given page.

Parameters:

ParameterTypeDescription
pagePageParent page of annotations.

isSynchronized()

public boolean isSynchronized()

Gets a value indicating whether access to the com.aspose.pdf.AnnotationCollection is synchronized (thread safe).

Returns: boolean - boolean value

getSyncRoot()

public Object getSyncRoot()

Gets an object that can be used to synchronize access to com.aspose.pdf.AnnotationCollection.

Returns: java.lang.Object - Object for sinchronization

size()

public int size()

Gets count of annotations in collection.

Returns: int - int value

isReadOnly()

public boolean isReadOnly()

Gets a value indicating if collection is readonly.

Returns: boolean - boolean value

add(Annotation annotation, boolean considerRotation)

public void add(Annotation annotation, boolean considerRotation)

Adds annotation to the collection. If page is rotated then annotation rectangle will be recalculated accordingly.

Parameters:

ParameterTypeDescription
annotationAnnotationAnnotation which shall be added.
considerRotationbooleanIf true and if page is rotated then annotation position will be recaculated accroding to page rotation.

add(Annotation annotation)

public void add(Annotation annotation)

Adds annotation to the collection.

Parameters:

ParameterTypeDescription
annotationAnnotationAnnotation which shall be added.

delete(int index)

public void delete(int index)

Deletes annotation from the collection by index.

Parameters:

ParameterTypeDescription
indexintIndex of annotation which shall be deleted.

delete()

public void delete()

Deletes all annotations from the collection.

copyTo(Annotation[] array, int index)

public void copyTo(Annotation[] array, int index)

Copies array of annotations into collection.

Parameters:

ParameterTypeDescription
arrayAnnotation[]Array to copy into collection.
indexintStarting index where colleciton wil lbe copied.

iterator()

public System.Collections.IEnumerator<Annotation> iterator()

Returns collection enumerator.

Returns: com.aspose.ms.System.Collections.IEnumerator<com.aspose.pdf.Annotation> - Enumerator object

accept(AnnotationSelector visitor)

public void accept(AnnotationSelector visitor)

Accepts visitor to process annotation.

Parameters:

ParameterTypeDescription
visitorAnnotationSelectorAnnotation selector object.

delete(Annotation annotation)

public void delete(Annotation annotation)

Deletes specified annotation from the collection.

Parameters:

ParameterTypeDescription
annotationAnnotationAnnotation which shall be deleted.

clear()

public void clear()

Deletes all annotations from the collection.

contains(Annotation annotation)

public boolean contains(Annotation annotation)

Checks if specified annotation belong to collection.

Parameters:

ParameterTypeDescription
annotationAnnotationAnnotation to be searched.

Returns: boolean - boolean value True - if annotation found; otherwise, false.

remove(Annotation annotation)

public boolean remove(Annotation annotation)

Deletes specified annotation from the collection.

Parameters:

ParameterTypeDescription
annotationAnnotationAnnotation which shall be deleted.

Returns: boolean - boolean value True - if annotation found; otherwise, false.

get_Item(int index)

public Annotation get_Item(int index)

The index of the element to get.

Parameters:

ParameterTypeDescription
indexintThe index value started from one.

Returns: Annotation - Annotation object

findByName(String name)

public final Annotation findByName(String name)

Returns annotation by its name.

Parameters:

ParameterTypeDescription
namejava.lang.StringName of the annotation

Returns: Annotation - Annotation object if found; otherwise, null.