- Direct Known Subclasses:
PdfBorderArray,PdfColor,PdfDashPattern,PdfDestination,PdfRectangle
PdfArray is the PDF Array object.
An array is a sequence of PDF objects. An array may contain a mixture of object types. An array is written as a left
square bracket ([), followed by a sequence of objects, followed by a right square bracket (]).
This object is
described in the 'Portable Document Format Reference Manual version 1.7' section 3.2.5 (page 58).
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.this is the actual array of PdfObjects -
Constructor Summary
ConstructorsConstructorDescriptionPdfArray()Deprecated.Constructs an emptyPdfArray-object.PdfArray(float[] values) Deprecated.Constructs aPdfArray-object, containing allfloatvalues in a specified array.PdfArray(int[] values) Deprecated.Constructs aPdfArray-object, containing allintvalues in a specified array.Deprecated.Constructs anPdfArray-object, containing allPdfObjects in a specifiedPdfArray.Deprecated.Constructs anPdfArray-object, containing 1PdfObject.Deprecated.Constructs aPdfArray, containing all elements of a specifiedList. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(float[] values) Deprecated.Adds an array offloatvalues to end of thePdfArray.booleanadd(int[] values) Deprecated.Adds an array ofintvalues to end of thePdfArray.voidDeprecated.Inserts the specified element at the specified position.booleanDeprecated.Adds aPdfObjectto the end of thePdfArray.voidDeprecated.Inserts aPdfObjectat the beginning of thePdfArray.booleanDeprecated.Checks if thePdfArrayalready contains a certainPdfObject.getAsArray(int idx) Deprecated.Returns aPdfObjectas aPdfArray, resolving indirect references.getAsBoolean(int idx) Deprecated.Returns aPdfObjectas aPdfBoolean, resolving indirect references.getAsDict(int idx) Deprecated.Returns aPdfObjectas aPdfDictionary, resolving indirect references.getAsIndirectObject(int idx) Deprecated.Returns aPdfObjectas aPdfIndirectReference.getAsName(int idx) Deprecated.Returns aPdfObjectas aPdfName, resolving indirect references.getAsNumber(int idx) Deprecated.Returns aPdfObjectas aPdfNumber, resolving indirect references.getAsStream(int idx) Deprecated.Returns aPdfObjectas aPdfStream, resolving indirect references.getAsString(int idx) Deprecated.Returns aPdfObjectas aPdfString, resolving indirect references.getDirectObject(int idx) Deprecated.Returns thePdfObjectwith the specified index, resolving a possible indirect reference to a direct object.Deprecated.Get a copy the internal list for this PdfArray.getPdfObject(int idx) Deprecated.Returns thePdfObjectwith the specified index.booleanisEmpty()Deprecated.Returnstrueif the array is empty.Deprecated.Returns the list iterator for the array.remove(int idx) Deprecated.Remove the element at the specified position from the array.booleanDeprecated.Removes the element from the list.Deprecated.Overwrites a specified location of the array, returning the previous valueintsize()Deprecated.Returns the number of entries in the array.voidtoPdf(PdfWriter writer, OutputStream os) Deprecated.Writes the PDF representation of thisPdfArrayas an array ofbyteto the specifiedOutputStream.toString()Deprecated.Returns a string representation of thisPdfArray.Methods inherited from class com.lowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
Field Details
-
arrayList
Deprecated.this is the actual array of PdfObjects
-
-
Constructor Details
-
PdfArray
public PdfArray()Deprecated.Constructs an emptyPdfArray-object. -
PdfArray
Deprecated.Constructs anPdfArray-object, containing 1PdfObject.- Parameters:
object- aPdfObjectthat has to be added to the array
-
PdfArray
public PdfArray(float[] values) Deprecated.Constructs aPdfArray-object, containing allfloatvalues in a specified array.The
floatvalues are internally converted toPdfNumberobjects.- Parameters:
values- an array offloatvalues to be added
-
PdfArray
public PdfArray(int[] values) Deprecated.Constructs aPdfArray-object, containing allintvalues in a specified array.The
intvalues are internally converted toPdfNumberobjects.- Parameters:
values- an array ofintvalues to be added
-
PdfArray
Deprecated.Constructs aPdfArray, containing all elements of a specifiedList.- Parameters:
pdfObjectList- anListwithPdfObjects to be added to the array- Since:
- 2.1.3
-
PdfArray
Deprecated.Constructs anPdfArray-object, containing allPdfObjects in a specifiedPdfArray.- Parameters:
array- aPdfArrayto be added to the array
-
-
Method Details
-
toPdf
Deprecated.Writes the PDF representation of thisPdfArrayas an array ofbyteto the specifiedOutputStream.- Overrides:
toPdfin classPdfObject- Parameters:
writer- for backwards compatibilityos- theOutputStreamto write the bytes to.- Throws:
IOException- on error
-
toString
Deprecated.Returns a string representation of thisPdfArray.The string representation consists of a list of all
PdfObjects contained in thisPdfArray, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). -
set
Deprecated.Overwrites a specified location of the array, returning the previous value- Parameters:
idx- The index of the element to be overwrittenobj- new value for the specified index- Returns:
- the previous value
- Throws:
IndexOutOfBoundsException- if the specified position doesn't exist- Since:
- 2.1.5
-
remove
Deprecated.Remove the element at the specified position from the array.Shifts any subsequent elements to the left (subtracts one from their indices).
- Parameters:
idx- The index of the element to be removed.- Returns:
- the PdfObject that was removed
- Throws:
IndexOutOfBoundsException- the specified position doesn't exist- Since:
- 2.1.5
-
remove
Deprecated.Removes the element from the list.Shifts any subsequent elements to the left (subtracts one from their indices).
- Parameters:
object- to be removed.
-
getElements
Deprecated.Get a copy the internal list for this PdfArray.- Returns:
- a copy of the the internal List.
-
size
public int size()Deprecated.Returns the number of entries in the array.- Returns:
- the size of the List
-
isEmpty
public boolean isEmpty()Deprecated.Returnstrueif the array is empty.- Returns:
trueif the array is empty- Since:
- 2.1.5
-
add
Deprecated.Adds aPdfObjectto the end of thePdfArray.The
PdfObjectwill be the last element.- Parameters:
object-PdfObjectto add- Returns:
- always
true
-
add
public boolean add(float[] values) Deprecated.Adds an array offloatvalues to end of thePdfArray.The values will be the last elements. The
floatvalues are internally converted toPdfNumberobjects.- Parameters:
values- An array offloatvalues to add- Returns:
- always
true
-
add
public boolean add(int[] values) Deprecated.Adds an array ofintvalues to end of thePdfArray.The values will be the last elements. The
intvalues are internally converted toPdfNumberobjects.- Parameters:
values- An array ofintvalues to add- Returns:
- always
true
-
add
Deprecated.Inserts the specified element at the specified position.Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
- Parameters:
index- The index at which the specified element is to be insertedelement- The element to be inserted- Throws:
IndexOutOfBoundsException- if the specified index is larger than the last position currently set, plus 1.- Since:
- 2.1.5
-
addFirst
Deprecated.Inserts aPdfObjectat the beginning of thePdfArray.The
PdfObjectwill be the first element, any other elements will be shifted to the right (adds one to their indices).- Parameters:
object- ThePdfObjectto add
-
contains
Deprecated.Checks if thePdfArrayalready contains a certainPdfObject.- Parameters:
object- ThePdfObjectto check- Returns:
true
-
listIterator
Deprecated.Returns the list iterator for the array.- Returns:
- a ListIterator
-
getPdfObject
Deprecated.Returns thePdfObjectwith the specified index.A possible indirect references is not resolved, so the returned
PdfObjectmay be either a direct object or an indirect reference, depending on how the object is stored in thePdfArray.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- A
PdfObject
-
getDirectObject
Deprecated.Returns thePdfObjectwith the specified index, resolving a possible indirect reference to a direct object.Thus this method will never return a
PdfIndirectReferenceobject.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- A direct
PdfObjectornull
-
getAsDict
Deprecated.Returns aPdfObjectas aPdfDictionary, resolving indirect references.The object corresponding to the specified index is retrieved and resolvedto a direct object. If it is a
PdfDictionary, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfDictionaryobject, ornull
-
getAsArray
Deprecated.Returns aPdfObjectas aPdfArray, resolving indirect references.The object corresponding to the specified index is retrieved and resolved to a direct object. If it is a
PdfArray, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfArrayobject, ornull
-
getAsStream
Deprecated.Returns aPdfObjectas aPdfStream, resolving indirect references.The object corresponding to the specified index is retrieved and resolved to a direct object. If it is a
PdfStream, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfStreamobject, ornull
-
getAsString
Deprecated.Returns aPdfObjectas aPdfString, resolving indirect references.The object corresponding to the specified index is retrieved and resolved to a direct object. If it is a
PdfString, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfStringobject, ornull
-
getAsNumber
Deprecated.Returns aPdfObjectas aPdfNumber, resolving indirect references.The object corresponding to the specified index is retrieved and resolved to a direct object. If it is a
PdfNumber, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfNumberobject, ornull
-
getAsName
Deprecated.Returns aPdfObjectas aPdfName, resolving indirect references.The object corresponding to the specified index is retrieved and resolved to a direct object. If it is a
PdfName, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfNameobject, ornull
-
getAsBoolean
Deprecated.Returns aPdfObjectas aPdfBoolean, resolving indirect references.The object corresponding to the specified index is retrieved and resolved to a direct object. If it is a
PdfBoolean, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfBooleanobject, ornull
-
getAsIndirectObject
Deprecated.Returns aPdfObjectas aPdfIndirectReference.The object corresponding to the specified index is retrieved. If it is a
PdfIndirectReference, it is cast down and returned as such. Otherwisenullis returned.- Parameters:
idx- The index of thePdfObjectto be returned- Returns:
- the corresponding
PdfIndirectReferenceobject, ornull
-