AnnotationCollection

Inheritance: java.lang.Object

All Implemented Interfaces: java.lang.Iterable

public final class AnnotationCollection implements Iterable<Annotation>

Class representing annotation collection.

Constructors

Constructor Description
AnnotationCollection(Page page) Constructor of AnnotationCollection.

Methods

Method Description
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:

Parameter Type Description
page Page Parent 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:

Parameter Type Description
annotation Annotation Annotation which shall be added.
considerRotation boolean If 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:

Parameter Type Description
annotation Annotation Annotation which shall be added.

delete(int index)

public void delete(int index)

Deletes annotation from the collection by index.

Parameters:

Parameter Type Description
index int Index 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:

Parameter Type Description
array Annotation[] Array to copy into collection.
index int Starting 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:

Parameter Type Description
visitor AnnotationSelector Annotation selector object.

delete(Annotation annotation)

public void delete(Annotation annotation)

Deletes specified annotation from the collection.

Parameters:

Parameter Type Description
annotation Annotation Annotation 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:

Parameter Type Description
annotation Annotation Annotation 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:

Parameter Type Description
annotation Annotation Annotation 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:

Parameter Type Description
index int The index value started from one.

Returns: Annotation - Annotation object

findByName(String name)

public final Annotation findByName(String name)

Returns annotation by its name.

Parameters:

Parameter Type Description
name java.lang.String Name of the annotation

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