Package com.datalogics.PDFL
Class OptionalContentOrderArray
java.lang.Object
com.datalogics.PDFL.OptionalContentOrderNode
com.datalogics.PDFL.OptionalContentOrderArray
Array node class for items in the OptionalContentConfig Order array. Items in the Order array can be arranged into a tree structure; subarrays within the parent array form 'branches' of the tree. Each OptionalContentOrderArray may contain OptionalContentOrderLeafs or OptionalContentOrderArrays in a specific order; this order determines how they will appear in the 'Layers' control of the viewer.
By placing OptionalContentOrderArrays into a higher-level array, branches can be added to the tree. The 'Title' property is a string that will appear next to the expand/collapse branch control in a PDF Viewer 'Layers' panel.
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an OptionalContentOrderArray with no title.OptionalContentOrderArray(Document doc, String title) Create an OptionalContentOrderArray with a title. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(OptionalContentOrderNode node) Adds an OptionalContentOrderNode to the end of the Array.voiddelete()get(int index) Returns the OptionalContentOrderNode at the given index.intThe number of OptionalContentOrderNodes in this array.getTitle()The title string of this Array.voidinsert(int index, OptionalContentOrderNode node) Inserts an OptionalContentOrderNode at the given index, displacing existing objects.voidput(int index, OptionalContentOrderNode node) Puts an OptionalContentOrderNode at the given index, replacing the existing item.voidremoveAt(int index) Removes the OptionalContentOrderNode at the given index.voidThe title string of this Array.
-
Constructor Details
-
OptionalContentOrderArray
Create an OptionalContentOrderArray with no title.- Parameters:
doc- The Document this OptionalContentOrderArray is being created in
-
OptionalContentOrderArray
Create an OptionalContentOrderArray with a title.- Parameters:
doc- The Document this OptionalContentOrderArray is being created intitle- The string which will appear in the Layer control panel
-
-
Method Details
-
delete
public void delete()- Overrides:
deletein classOptionalContentOrderNode
-
getTitle
The title string of this Array. This title will appear next to the expand/collapse control in the 'Layers' panel of a PDF Viewer.This field may be set null to remove the title.
- Returns:
- The title string of this OptionalContentOrderArray.
-
setTitle
The title string of this Array. This title will appear next to the expand/collapse control in the 'Layers' panel of a PDF Viewer.This field may be set null to remove the title.
- Parameters:
title- The title string of this OptionalContentOrderArray.
-
getLength
public int getLength()The number of OptionalContentOrderNodes in this array. -
get
Returns the OptionalContentOrderNode at the given index.- Parameters:
index- The index at which to fetch an OptionalContentOrderNode.- Returns:
- An OptionalContentOrderNode, or null if there is nothing at that index.
-
put
Puts an OptionalContentOrderNode 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.- Parameters:
index- The index at which to replace the existing Nodenode- The OptionalContentOrderNode to place in the Array
-
insert
Inserts an OptionalContentOrderNode at the given index, displacing existing objects. All objects following this will have their index increased by one.- Parameters:
index- The index at which to insert the Nodenode- The OptionalContentOrderNode to insert in the Array
-
add
Adds an OptionalContentOrderNode to the end of the Array.- Parameters:
node- The OptionalContentOrderNode to append to the Array
-
removeAt
public void removeAt(int index) Removes the OptionalContentOrderNode at the given index. The length of the array is reduced by 1.- Parameters:
index- The index of the OptionalContentOrderNode to remove
-