| Modifier and Type | Field and Description |
|---|---|
protected List<PdfObject> |
list |
ARRAY, BOOLEAN, DICTIONARY, FLUSHED, FORBID_RELEASE, FREE, INDIRECT_REFERENCE, indirectReference, LITERAL, MODIFIED, MUST_BE_FLUSHED, MUST_BE_INDIRECT, NAME, NULL, NUMBER, ORIGINAL_OBJECT_STREAM, READ_ONLY, READING, STREAM, STRING, UNENCRYPTED| Constructor and Description |
|---|
PdfArray()
Create a new, empty PdfArray.
|
PdfArray(boolean[] values)
Create a new PdfArray filled with the values in the boolean[] as
PdfBoolean. |
PdfArray(double[] numbers)
Create a new PdfArray filled with the values in the double[] as
PdfNumber. |
PdfArray(float[] numbers)
Create a new PdfArray filled with the values in the float[] as
PdfNumber. |
PdfArray(int[] numbers)
Create a new PdfArray filled with the values in the int[] as
PdfNumber. |
PdfArray(Iterable<? extends PdfObject> objects,
int initialCapacity)
Create a new PdfArray.
|
PdfArray(List<? extends PdfObject> objects)
Create a new PdfArray.
|
PdfArray(List<String> strings,
boolean asNames)
Create a new PdfArray filled with a list of Strings.
|
PdfArray(PdfArray arr)
Create a new PdfArray.
|
PdfArray(PdfObject obj)
Create a new PdfArray with the provided PdfObject as the first item in the
array.
|
PdfArray(Rectangle rectangle)
Create a new PdfArray.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
PdfObject element)
Adds the specified PdfObject at the specified index.
|
void |
add(PdfObject pdfObject) |
void |
addAll(Collection<PdfObject> c)
Adds the Collection of PdfObjects.
|
void |
addAll(PdfArray a)
Adds content of the
PdfArray. |
void |
clear() |
boolean |
contains(PdfObject o) |
protected void |
copyContent(PdfObject from,
PdfDocument document,
ICopyFilter copyFilter)
Copies object content from object 'from'.
|
PdfObject |
get(int index)
Gets the (direct) PdfObject at the specified index.
|
PdfObject |
get(int index,
boolean asDirect) |
PdfArray |
getAsArray(int index)
Returns the element at the specified index as a PdfArray.
|
PdfBoolean |
getAsBoolean(int index)
Returns the element at the specified index as a PdfBoolean.
|
PdfDictionary |
getAsDictionary(int index)
Returns the element at the specified index as a PdfDictionary.
|
PdfName |
getAsName(int index)
Returns the element at the specified index as a PdfName.
|
PdfNumber |
getAsNumber(int index)
Returns the element at the specified index as a PdfNumber.
|
PdfStream |
getAsStream(int index)
Returns the element at the specified index as a PdfStream.
|
PdfString |
getAsString(int index)
Returns the element at the specified index as a PdfString.
|
byte |
getType()
Gets object type.
|
int |
indexOf(PdfObject o)
Gets the first index of the specified PdfObject.
|
boolean |
isEmpty() |
Iterator<PdfObject> |
iterator()
Returns an iterator over an array of PdfObject elements.
|
protected PdfObject |
newInstance()
Creates new instance of object.
|
protected void |
releaseContent()
Release content of PdfArray.
|
void |
remove(int index)
Removes the PdfObject at the specified index.
|
void |
remove(PdfObject o)
Removes the first occurrence of the specified PdfObject, if it is present.
|
PdfObject |
set(int index,
PdfObject element)
Sets the PdfObject at the specified index in the PdfArray.
|
int |
size() |
List<PdfObject> |
subList(int fromIndex,
int toIndex)
Returns a sublist of this PdfArray, starting at fromIndex (inclusive) and ending at toIndex (exclusive).
|
boolean[] |
toBooleanArray()
Returns this array as an array of booleans.
|
double[] |
toDoubleArray()
Returns this array as an array of doubles.
|
float[] |
toFloatArray()
Returns this array as an array of floats.
|
int[] |
toIntArray()
Returns this array as an array of ints.
|
List<PdfObject> |
toList()
Returns unmodifiable
List representation of this PdfArray. |
long[] |
toLongArray()
Returns this array as an array of longs.
|
Rectangle |
toRectangle()
Returns the first four elements of this array as a PdfArray.
|
String |
toString() |
checkState, clearState, clone, clone, containsIndirectReference, copyContent, copyTo, copyTo, copyTo, copyTo, flush, flush, getIndirectReference, isArray, isBoolean, isDictionary, isFlushed, isIndirect, isIndirectReference, isLiteral, isModified, isName, isNull, isNumber, isReleaseForbidden, isStream, isString, makeIndirect, makeIndirect, release, setIndirectReference, setModified, setStateequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic PdfArray()
public PdfArray(PdfObject obj)
obj - first item in the arraypublic PdfArray(PdfArray arr)
arr - PdfArray containing items that will added to this PdfArraypublic PdfArray(Rectangle rectangle)
rectangle - Rectangle whose 4 values will be added to the PdfArraypublic PdfArray(List<? extends PdfObject> objects)
objects - List of PdfObjects to be added to this PdfArraypublic PdfArray(float[] numbers)
PdfNumber.numbers - values to be added to this PdfArraypublic PdfArray(double[] numbers)
PdfNumber.numbers - values to be added to this PdfArraypublic PdfArray(int[] numbers)
PdfNumber.numbers - values to be added to this PdfArraypublic PdfArray(boolean[] values)
PdfBoolean.values - values to be added to this PdfArraypublic PdfArray(List<String> strings, boolean asNames)
PdfName (true) or as PdfString (false).strings - list of strings to be added to the listasNames - indicates whether the strings should be added as PdfName (true) or as PdfString (false)public int size()
public boolean isEmpty()
public boolean contains(PdfObject o)
public Iterator<PdfObject> iterator()
PdfIndirectReference instances for the indirect objects value,
you shall use get(int, boolean) method.public void add(PdfObject pdfObject)
public void add(int index,
PdfObject element)
index - position to insert the PdfObjectelement - PdfObject to be addedList.add(int, Object)public PdfObject set(int index, PdfObject element)
index - the position to set the PdfObjectelement - PdfObject to be addedList.set(int, Object)public void addAll(Collection<PdfObject> c)
c - the Collection of PdfObjects to be addedList.addAll(java.util.Collection)public void addAll(PdfArray a)
PdfArray.a - the PdfArray to be addedList.addAll(java.util.Collection)public PdfObject get(int index)
index - index of the PdfObject in the PdfArraypublic void remove(int index)
index - position of the PdfObject to be removedList.remove(int)public void remove(PdfObject o)
o - a PdfObject to be removedList.remove(Object)public void clear()
public int indexOf(PdfObject o)
o - PdfObject to find the index ofList.indexOf(Object)public List<PdfObject> subList(int fromIndex, int toIndex)
fromIndex - the position of the first element in the sublist (inclusive)toIndex - the position of the last element in the sublist (exclusive)List.subList(int, int)public List<PdfObject> toList()
List representation of this PdfArray.List representation of this PdfArraypublic byte getType()
PdfObjectpublic PdfObject get(int index, boolean asDirect)
asDirect - true is to extract direct object always.index - index of the element to returnpublic PdfArray getAsArray(int index)
index - position of the element to be returnedpublic PdfDictionary getAsDictionary(int index)
index - position of the element to be returnedpublic PdfStream getAsStream(int index)
index - position of the element to be returnedpublic PdfNumber getAsNumber(int index)
index - position of the element to be returnedpublic PdfName getAsName(int index)
index - position of the element to be returnedpublic PdfString getAsString(int index)
index - position of the element to be returnedpublic PdfBoolean getAsBoolean(int index)
index - position of the element to be returnedpublic Rectangle toRectangle()
PdfException - if one of the first values isn't a PdfNumberpublic float[] toFloatArray()
PdfException - if one of the values isn't a numberpublic double[] toDoubleArray()
PdfException - if one of the values isn't a numberpublic long[] toLongArray()
PdfException - if one of the values isn't a numberpublic int[] toIntArray()
PdfException - if one of the values isn't a numberpublic boolean[] toBooleanArray()
PdfException - if one of the values isn't a booleanprotected PdfObject newInstance()
PdfObjectnewInstance in class PdfObjectprotected void copyContent(PdfObject from, PdfDocument document, ICopyFilter copyFilter)
PdfObjectcopyContent in class PdfObjectfrom - object to copy content from.document - document to copy object to.copyFilter - ICopyFilter a filter that will apply on dictionaries and array
Use NullCopyFilter for no filteringprotected void releaseContent()
Copyright © 1998–2025 Apryse Group NV. All rights reserved.