Package org.apache.fop.pdf
Class PDFArray
- java.lang.Object
-
- org.apache.fop.pdf.PDFObject
-
- org.apache.fop.pdf.PDFArray
-
- All Implemented Interfaces:
PDFWritable
- Direct Known Subclasses:
PDFCIELabColorSpace,PDFSeparationColorSpace
public class PDFArray extends PDFObject
Class representing an array object.
-
-
Constructor Summary
Constructors Constructor Description PDFArray()Create a new, empty array object with no parent.PDFArray(java.lang.Object... elements)Creates an array object made of the given elements.PDFArray(java.util.List<?> elements)Creates an array object made of the given elements.PDFArray(PDFObject parent)Create a new, empty array objectPDFArray(PDFObject parent, double[] values)Create an array object.PDFArray(PDFObject parent, int[] values)Create an array object.PDFArray(PDFObject parent, java.lang.Object[] values)Create the array objectPDFArray(PDFObject parent, java.util.List<?> values)Create an array object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(double value)Adds a new value to the array.voidadd(java.lang.Object obj)Adds a new value to the array.voidclear()Clears the PDF array.booleancontains(java.lang.Object obj)Indicates whether the given object exists in the array.java.lang.Objectget(int index)Gets an entry at a given location.voidgetChildren(java.util.Set<PDFObject> children)intlength()Returns the length of the arrayintoutput(java.io.OutputStream stream)Write the PDF represention of this objectvoidset(int index, double value)Sets an entry at a given location.voidset(int index, java.lang.Object obj)Sets an entry at a given location.-
Methods inherited from class org.apache.fop.pdf.PDFObject
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
-
-
-
Constructor Detail
-
PDFArray
public PDFArray(PDFObject parent)
Create a new, empty array object- Parameters:
parent- the array's parent if any
-
PDFArray
public PDFArray()
Create a new, empty array object with no parent.
-
PDFArray
public PDFArray(PDFObject parent, int[] values)
Create an array object.- Parameters:
parent- the array's parent if anyvalues- the actual array wrapped by this object
-
PDFArray
public PDFArray(PDFObject parent, double[] values)
Create an array object.- Parameters:
parent- the array's parent if anyvalues- the actual array wrapped by this object
-
PDFArray
public PDFArray(PDFObject parent, java.util.List<?> values)
Create an array object.- Parameters:
parent- the array's parent if anyvalues- the actual values wrapped by this object
-
PDFArray
public PDFArray(java.lang.Object... elements)
Creates an array object made of the given elements.- Parameters:
elements- the array content
-
PDFArray
public PDFArray(java.util.List<?> elements)
Creates an array object made of the given elements.- Parameters:
elements- the array content
-
PDFArray
public PDFArray(PDFObject parent, java.lang.Object[] values)
Create the array object- Parameters:
parent- the array's parent if anyvalues- the actual array wrapped by this object
-
-
Method Detail
-
contains
public boolean contains(java.lang.Object obj)
Indicates whether the given object exists in the array.- Parameters:
obj- the object to look for- Returns:
- true if obj is contained
-
length
public int length()
Returns the length of the array- Returns:
- the length of the array
-
set
public void set(int index, java.lang.Object obj)Sets an entry at a given location.- Parameters:
index- the index of the value to setobj- the new value
-
set
public void set(int index, double value)Sets an entry at a given location.- Parameters:
index- the index of the value to setvalue- the new value
-
get
public java.lang.Object get(int index)
Gets an entry at a given location.- Parameters:
index- the index of the value to set- Returns:
- the requested value
-
add
public void add(java.lang.Object obj)
Adds a new value to the array.- Parameters:
obj- the value
-
add
public void add(double value)
Adds a new value to the array.- Parameters:
value- the value
-
clear
public void clear()
Clears the PDF array.
-
output
public int output(java.io.OutputStream stream) throws java.io.IOExceptionWrite the PDF represention of this object
-
getChildren
public void getChildren(java.util.Set<PDFObject> children)
- Overrides:
getChildrenin classPDFObject
-
-