public class PDFArray extends PDFObject
Modifier and Type | Field and Description |
---|---|
protected List<Object> |
values
List holding the values of this array
|
Constructor and Description |
---|
PDFArray()
Create a new, empty array object with no parent.
|
PDFArray(List<?> elements)
Creates an array object made of the given elements.
|
PDFArray(Object... elements)
Creates an array object made of the given elements.
|
PDFArray(PDFObject parent)
Create a new, empty array object
|
PDFArray(PDFObject parent,
double[] values)
Create an array object.
|
PDFArray(PDFObject parent,
int[] values)
Create an array object.
|
PDFArray(PDFObject parent,
List<?> values)
Create an array object.
|
PDFArray(PDFObject parent,
Object[] values)
Create the array object
|
Modifier and Type | Method and Description |
---|---|
void |
add(double value)
Adds a new value to the array.
|
void |
add(Object obj)
Adds a new value to the array.
|
void |
clear()
Clears the PDF array.
|
boolean |
contains(Object obj)
Indicates whether the given object exists in the array.
|
Object |
get(int index)
Gets an entry at a given location.
|
void |
getChildren(Set<PDFObject> children) |
int |
length()
Returns the length of the array
|
int |
output(OutputStream stream)
Write the PDF represention of this object
|
void |
set(int index,
double value)
Sets an entry at a given location.
|
void |
set(int index,
Object obj)
Sets an entry at a given location.
|
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, supportsObjectStream, toPDF, toPDFString
public PDFArray(PDFObject parent)
parent
- the array's parent if anypublic PDFArray()
public PDFArray(PDFObject parent, int[] values)
parent
- the array's parent if anyvalues
- the actual array wrapped by this objectpublic PDFArray(PDFObject parent, double[] values)
parent
- the array's parent if anyvalues
- the actual array wrapped by this objectpublic PDFArray(PDFObject parent, List<?> values)
parent
- the array's parent if anyvalues
- the actual values wrapped by this objectpublic PDFArray(Object... elements)
elements
- the array contentpublic PDFArray(List<?> elements)
elements
- the array contentpublic boolean contains(Object obj)
obj
- the object to look forpublic int length()
public void set(int index, Object obj)
index
- the index of the value to setobj
- the new valuepublic void set(int index, double value)
index
- the index of the value to setvalue
- the new valuepublic Object get(int index)
index
- the index of the value to setpublic void add(Object obj)
obj
- the valuepublic void add(double value)
value
- the valuepublic void clear()
public int output(OutputStream stream) throws IOException
output
in class PDFObject
stream
- the stream to write the PDF toIOException
- if there is an error writing to the streampublic void getChildren(Set<PDFObject> children)
getChildren
in class PDFObject
Copyright © 2025 Apache Software Foundation. All rights reserved.