public class CosArray extends CosContainer
Modifier and Type | Class and Description |
---|---|
class |
CosArray.CosArrayListIterator |
DIRECT, INDIRECT, t_Array, t_Boolean, t_Dictionary, t_KeyAbsent, t_Name, t_Null, t_Numeric, t_ObjectRef, t_Stream, t_String
Modifier and Type | Method and Description |
---|---|
boolean |
add(CosObject cosObject)
Appends the specified CosObject to the end of this list.
|
void |
add(int pos,
CosObject cosObject)
Inserts the specified element at the specified position in this
list.
|
boolean |
addBoolean(boolean value)
Creates an appropriate cos object and adds it to array.
|
void |
addBoolean(int pos,
boolean value)
Creates an appropriate cos object and adds it to array at specified position.
|
boolean |
addDouble(double value)
Creates an appropriate cos object and adds it to array.
|
void |
addDouble(int pos,
double value)
Creates an appropriate cos object and adds it to array at specified position.
|
boolean |
addInt(int value)
Creates an appropriate cos object and adds it to array.
|
void |
addInt(int pos,
int value)
Creates an appropriate cos object and adds it to array at specified position.
|
void |
addLong(int pos,
long value)
Creates an appropriate cos object and adds it to array at specified position.
|
boolean |
addLong(long value)
Creates an appropriate cos object and adds it to array.
|
boolean |
addName(ASName value)
Creates an appropriate cos object and adds it to array.
|
void |
addName(int pos,
ASName value)
Creates an appropriate cos object and adds it to array at specified position.
|
boolean |
addString(ASString value)
Creates an appropriate cos object and adds it to array.
|
void |
addString(int pos,
ASString value)
Creates an appropriate cos object and adds it to array at specified position.
|
void |
addText(int pos,
String value)
Creates an appropriate cos object and adds it to array at specified position.
|
boolean |
addText(String value)
Creates an appropriate cos object and adds it to array.
|
void |
clear()
Removes all elements from the CosArray.
|
boolean |
contains(CosObject obj)
Returns true if this array contains the object passed, else false.
|
boolean |
equals(CosObject value)
This method checks the inside data of CosArray and returns true if they are
clone of each other.
|
void |
extendIfNecessaryAndSet(int pos,
CosObject cosObject)
Adds the CosObject at the specified position in this list.
|
int |
findName(ASName name)
Returns the index of name object with the same name as passed.
|
int |
findString(ASString name)
Looks for the CosString in the array.
|
CosObject |
get(int pos)
Obtains the specified element from the array.
|
byte[][] |
getArrayBytes()
getArrayBytes() presumes that the CosArray contains string values only
and delivers an array of array of byte values.
|
double[] |
getArrayDouble()
getArrayDouble() presumes that the CosArray contains numeric values only
and delivers an array of double values.
|
double[] |
getArrayDouble(int start,
int length)
getArrayDouble() presumes that the CosArray contains numeric values only
and delivers an array of double values.
|
int[] |
getArrayInt()
getArrayInt() presumes that the CosArray contains numeric values only
and delivers an array of integer values.
|
long[] |
getArrayLong()
getArrayInt() presumes that the CosArray contains numeric values only
and delivers an array of integer values.
|
ASName[] |
getArrayName()
getArrayName() presumes that the CosArray contains ASName values only
and delivers an array of ASName values.
|
boolean |
getBoolean(int pos)
It assumes that the object at index "pos" is of type
CosBoolean
and returns it's value. |
CosArray |
getCosArray(int pos)
It assumes that the object at index "pos" is of type
CosArray
and returns it's value. |
CosDictionary |
getCosDictionary(int pos)
It assumes that the object at index "pos" is of type
CosDictionary
and returns it's value. |
CosStream |
getCosStream(int pos)
It assumes that the object at index "pos" is of type
CosStream
and returns it's value. |
CosString |
getCosString(int pos)
It assumes that the object at index "pos" is of type
CosString
and returns it's value. |
double |
getDouble(int pos)
It assumes that the object at index "pos" is of type
CosNumeric
and returns it's value. |
ASHexString |
getHexString(int pos)
It assumes that the object at index "pos" is of type
CosString
and returns it's value. |
int |
getInt(int pos)
It assumes that the object at index "pos" is of type
CosNumeric
and returns it's value. |
long |
getLong(int pos)
It assumes that the object at index "pos" is of type
CosNumeric
and returns it's value. |
ASName |
getName(int pos)
It assumes that the object at index "pos" is of type
CosName
and returns it's value. |
InputByteStream |
getStream(int pos)
This gets a slice of the underlying
InputByteStream . |
ASString |
getString(int pos)
It assumes that the object at index "pos" is of type
CosString
and returns it's value. |
String |
getText(int pos)
It assumes that the object at index "pos" is of type
CosString
and returns it's value. |
int |
getType()
return the type of this CosObject
|
int |
getType(int pos)
Returns the type of the value at the given position
|
ArrayList<Object> |
getValue() |
CosContainerValuesIterator |
getValuesIterator() |
boolean |
isEmpty()
Tests whether the array contains any elements.
|
Iterator<CosObject> |
iterator()
Returns an iterator over the elements of the array.
|
ListIterator<CosObject> |
listIterator()
Returns a list iterator over the elements of the array.
|
boolean |
remove(CosObject cosObject)
Removes all instances of the specified object from the array.
|
CosObject |
remove(int index)
Removes the element at the specified position in this list.
|
boolean |
set(int pos,
CosObject cosObject)
Adds the CosObject at the specified position in this list.
|
boolean |
setBoolean(int pos,
boolean value)
Creates an appropriate cos object and sets it to array at specified position.
|
boolean |
setDouble(int pos,
double value)
Creates an appropriate cos object and sets it to array at specified position.
|
void |
setEncryptionState(boolean state)
Set the specified encryption state for all strings and streams in an array recursively
|
boolean |
setInt(int pos,
int value)
Creates an appropriate cos object and sets it to array at specified position.
|
boolean |
setLong(int pos,
long value)
Creates an appropriate cos object and sets it to array at specified position.
|
boolean |
setName(int pos,
ASName value)
Creates an appropriate cos object and sets it to array at specified position.
|
boolean |
setName(int pos,
String value)
Creates an appropriate cos object and sets it to array at specified position.
|
boolean |
setString(int pos,
ASString value)
Creates an appropriate cos object and sets it to array at specified position.
|
boolean |
setText(int pos,
String value)
Creates an appropriate cos object and sets it to array at specified position.
|
int |
size()
Returns the number of elements in the array.
|
CosArray |
splitBefore(int pos)
Returns a new array containing all the values before "pos" index in
current array.
|
findObjPos, markNotDirty
booleanValue, doubleValue, equals, getDocument, getObjEOF, getObjGen, getObjNum, getObjPos, getObjRevision, getStreamManager, hexStringValue, intValue, isCompressed, isDirty, isIndirect, longValue, nameValue, numberValue, stringValue, textValue, toString
public int getType()
public int size()
public boolean isEmpty()
public Iterator<CosObject> iterator()
public ListIterator<CosObject> listIterator()
public CosContainerValuesIterator getValuesIterator()
getValuesIterator
in class CosContainer
public ArrayList<Object> getValue() throws PDFCosParseException, PDFIOException, PDFSecurityException
getValue
in class CosObject
PDFCosParseException
PDFIOException
PDFSecurityException
public boolean contains(CosObject obj)
public int findName(ASName name) throws PDFCosParseException, PDFIOException, PDFSecurityException
public int findString(ASString name) throws PDFCosParseException, PDFIOException, PDFSecurityException
public CosObject get(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
pos
- Zero-based index of the desired array elementPDFCosParseException
PDFIOException
PDFSecurityException
public int getType(int pos)
pos
- public ASName getName(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosName
and returns it's value.public boolean getBoolean(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosBoolean
and returns it's value.public double getDouble(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosNumeric
and returns it's value.public double[] getArrayDouble() throws PDFCosParseException, PDFIOException, PDFSecurityException
public double[] getArrayDouble(int start, int length) throws PDFCosParseException, PDFIOException, PDFSecurityException
start
- the index to start conversion fromlength
- the number of indices to convertPDFCosParseException
PDFIOException
PDFSecurityException
public long getLong(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosNumeric
and returns it's value.public int getInt(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosNumeric
and returns it's value.public long[] getArrayLong() throws PDFCosParseException, PDFIOException, PDFSecurityException
public int[] getArrayInt() throws PDFCosParseException, PDFIOException, PDFSecurityException
public byte[][] getArrayBytes() throws PDFCosParseException, PDFIOException, PDFSecurityException
public ASString getString(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosString
and returns it's value.public ASHexString getHexString(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosString
and returns it's value.public String getText(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosString
and returns it's value.public CosString getCosString(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosString
and returns it's value.public CosArray getCosArray(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosArray
and returns it's value.public CosDictionary getCosDictionary(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosDictionary
and returns it's value.public CosStream getCosStream(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
CosStream
and returns it's value.public InputByteStream getStream(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
InputByteStream
. It is the repsonsibility
of the caller to close the InputByteStream
when they are finished with it.public void clear() throws PDFCosParseException, PDFIOException, PDFSecurityException
public CosObject remove(int index) throws PDFCosParseException, PDFIOException, PDFSecurityException
index
- the index of the element to removed.PDFCosParseException
PDFIOException
PDFSecurityException
IndexOutOfBoundsException
- if index out of rangepublic boolean remove(CosObject cosObject) throws PDFCosParseException, PDFIOException, PDFSecurityException
cosObject
- Object to be removed from the arrayPDFCosParseException
PDFIOException
PDFSecurityException
public boolean add(CosObject cosObject) throws PDFCosParseException, PDFIOException, PDFSecurityException
cosObject
- to be added to the listPDFIOException
PDFCosParseException
PDFSecurityException
public boolean addName(ASName value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean addBoolean(boolean value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean addDouble(double value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean addLong(long value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean addInt(int value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean addText(String value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean addString(ASString value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public void add(int pos, CosObject cosObject) throws PDFCosParseException, PDFIOException, PDFSecurityException
pos
- index at which the specified element is to be inserted.cosObject
- element to be inserted.PDFCosParseException
PDFIOException
PDFSecurityException
IndexOutOfBoundsException
- if index is out of rangepublic void addName(int pos, ASName value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public void addBoolean(int pos, boolean value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public void addDouble(int pos, double value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public void addLong(int pos, long value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public void addInt(int pos, int value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public void addText(int pos, String value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public void addString(int pos, ASString value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean set(int pos, CosObject cosObject) throws PDFCosParseException, PDFIOException, PDFSecurityException
pos
- index of element being added.cosObject
- element to be added at the specified position.PDFCosParseException
PDFIOException
PDFSecurityException
IndexOutOfBoundsException
- if index out of rangepublic void extendIfNecessaryAndSet(int pos, CosObject cosObject) throws PDFCosParseException, PDFIOException, PDFSecurityException
pos
- index of element being added.cosObject
- element to be added at the specified position.PDFCosParseException
PDFIOException
PDFSecurityException
public boolean setName(int pos, ASName value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean setName(int pos, String value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean setBoolean(int pos, boolean value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean setDouble(int pos, double value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean setInt(int pos, int value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean setLong(int pos, long value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean setString(int pos, ASString value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean setText(int pos, String value) throws PDFCosParseException, PDFIOException, PDFSecurityException
public boolean equals(CosObject value)
public void setEncryptionState(boolean state) throws PDFCosParseException, PDFIOException, PDFSecurityException
public CosArray splitBefore(int pos) throws PDFCosParseException, PDFIOException, PDFSecurityException
public ASName[] getArrayName() throws PDFCosParseException, PDFIOException, PDFSecurityException
Copyright © 2010 - 2020 Adobe. All Rights Reserved