PdfArray

Overview

PdfArray is a class in Aspose.PDF FOSS for Java. Inherits from: PdfBase, Iterable<PdfBase>.

PDF array object (§7.3.6, ISO 32000-1:2008).

This class provides 30 methods for working with PdfArray objects in Java programs. Available methods include: PdfArray, accept, add, clear, equals, get, getArray, getDictionary, getFloat, getInt, getLong, getName, and 16 additional methods. All public members are accessible to any Java application after installing the Aspose.PDF FOSS for Java package. Properties: dirty, empty, indirect, objectKey.

Properties

NameTypeAccessDescription
emptybooleanReadReturns whether the array is empty.
dirtybooleanReadReturns {@code true} if this object was modified since loading.
indirectbooleanReadReturns whether this object is an indirect object (has an object key).
objectKeyPdfObjectKeyReadReturns the indirect object key, or {@code null} for direct objects.

Methods

SignatureDescription
PdfArray()Creates an empty array with default initial capacity.
PdfArray(initialCapacity: int)Creates an empty array with the specified initial capacity.
size()intReturns the number of elements.
isEmpty()booleanReturns whether the array is empty.
get(index: int)PdfBaseReturns the element at the given index.
add(item: PdfBase)Appends an element to the end.
add(index: int, item: PdfBase)Inserts an element at the given index.
set(index: int, item: PdfBase)PdfBaseReplaces the element at the given index.
remove(index: int)PdfBaseRemoves the element at the given index.
clear()Removes all elements.
getInt(index: int, defaultValue: int)intReturns the element at the given index as an int, or the default value
if the element is not a numeric type.
getLong(index: int, defaultValue: long)longReturns the element at the given index as a long, or the default value.
getFloat(index: int, defaultValue: float)floatReturns the element at the given index as a float, or the default value.
getName(index: int)StringReturns the element at the given index as a name string, or null.
getString(index: int)StringReturns the element at the given index as a string value, or null.
getDictionary(index: int)PdfDictionaryReturns the element at the given index as a PdfDictionary, or null.
getArray(index: int)PdfArrayReturns the element at the given index as a PdfArray, or null.
toFloatArray()float[]Converts this array to a float[].
toIntArray()int[]Converts this array to an int[].
iterator()Iterator<PdfBase>
writeTo(os: OutputStream)
accept(visitor: IPdfVisitor<T>)T
equals(o: Object)boolean
hashCode()int
toString()String
isDirty()booleanReturns {@code true} if this object was modified since loading.
setDirty(dirty: boolean)Sets the dirty flag on this object.
isIndirect()booleanReturns whether this object is an indirect object (has an object key).
getObjectKey()PdfObjectKeyReturns the indirect object key, or {@code null} for direct objects.
setObjectKey(key: PdfObjectKey)Sets the indirect object key.

See Also