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
Class representing an array object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList holding the values of this array -
Constructor Summary
ConstructorsConstructorDescriptionPDFArray()Create a new, empty array object with no parent.Creates an array object made of the given elements.Creates an array object made of the given elements.Create a new, empty array objectCreate an array object.Create an array object.Create the array objectCreate an array object. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double value) Adds a new value to the array.voidAdds a new value to the array.voidclear()Clears the PDF array.booleanIndicates whether the given object exists in the array.get(int index) Gets an entry at a given location.voidgetChildren(Set<PDFObject> children) intlength()Returns the length of the arrayintoutput(OutputStream stream) Write the PDF represention of this objectvoidset(int index, double value) Sets an entry at a given location.voidSets 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
-
Field Details
-
values
List holding the values of this array
-
-
Constructor Details
-
PDFArray
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
Create an array object.- Parameters:
parent- the array's parent if anyvalues- the actual array wrapped by this object
-
PDFArray
Create an array object.- Parameters:
parent- the array's parent if anyvalues- the actual array wrapped by this object
-
PDFArray
Create an array object.- Parameters:
parent- the array's parent if anyvalues- the actual values wrapped by this object
-
PDFArray
Creates an array object made of the given elements.- Parameters:
elements- the array content
-
PDFArray
Creates an array object made of the given elements.- Parameters:
elements- the array content
-
PDFArray
Create the array object- Parameters:
parent- the array's parent if anyvalues- the actual array wrapped by this object
-
-
Method Details
-
contains
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
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
Gets an entry at a given location.- Parameters:
index- the index of the value to set- Returns:
- the requested value
-
add
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
Write the PDF represention of this object- Overrides:
outputin classPDFObject- Parameters:
stream- the stream to write the PDF to- Returns:
- the number of bytes written
- Throws:
IOException- if there is an error writing to the stream
-
getChildren
- Overrides:
getChildrenin classPDFObject
-