Package com.datalogics.PDFL
Class PDFArray
java.lang.Object
com.datalogics.PDFL.PDFObject
com.datalogics.PDFL.PDFArray
Represents an array of data elements within a PDF document. All objects in a PDF document are built from a collection of simpler objects that represent fundamental datatypes like numbers, strings and arrays. PDFObject and its subclasses allow direct access and manipulation of these simple objects. Some subclasses represent single data elements. For example, PDFInteger represents a single integer value. Others represent a collection of PDFObjects, like PDFArray, an indexed array of data elements.
A PDFArray is a heterogenous collection object that gathers other PDFObjects (including other PDFArrays) into an indexed list.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an object to the end of the arrayvoiddelete()get(int index) Returns the object at the given index.intThe number of elements in this array.voidInserts an object at the given index, displacing existing objects.voidPuts an object at the given index, replacing the existing item.voidRemoves the first object that matches the given object.voidremoveAt(int index) Removes the object at the given index.toString()Methods inherited from class com.datalogics.PDFL.PDFObject
clone, clone, clone, clone, clone, compareTo, destroy, enumPDFObjects, equals, getDocument, getGeneration, getID, getIndirect, getPDFHashValue
-
Constructor Details
-
PDFArray
General constructor- Parameters:
doc- Document object containing this PDFArrayindirect- flag marking this as an indirect PDFObject
-
PDFArray
General constructor- Parameters:
docFromObj- The new PDFArray will be created in the same document as this object.indirect- flag marking this as an indirect PDFObject
-
-
Method Details
-
delete
public void delete() -
toString
-
add
Adds an object to the end of the array -
put
Puts an object at the given index, replacing the existing item. The index can be greater than the current length of the array; the array will be extended and the empty slots filled with null objects. -
insert
Inserts an object at the given index, displacing existing objects. All objects following this will have their index increased by one. -
remove
Removes the first object that matches the given object. The length of the array is reduced by 1. -
removeAt
public void removeAt(int index) Removes the object at the given index. The length of the array is reduced by 1. -
get
Returns the object at the given index. -
getLength
public int getLength()The number of elements in this array.
-