Class CosArray


  • public class CosArray
    extends CosContainer
    Represents a COS array as defined in section 3.2.5 of the PDF Reference Manual version 1.4.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int pos, CosObject cosObject)
      Inserts the specified element at the specified position in this list.
      boolean add​(CosObject cosObject)
      Appends the specified CosObject to the end of 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.
      void addName​(int pos, ASName value)
      Creates an appropriate cos object and adds it to array at specified position.
      boolean addName​(ASName 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.
      boolean addString​(ASString value)
      Creates an appropriate cos object and adds it to array.
      void addText​(int pos, java.lang.String value)
      Creates an appropriate cos object and adds it to array at specified position.
      boolean addText​(java.lang.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.
      java.lang.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
      java.util.ArrayList<java.lang.Object> getValue()  
      CosContainerValuesIterator getValuesIterator()  
      boolean isEmpty()
      Tests whether the array contains any elements.
      java.util.Iterator<CosObject> iterator()
      Returns an iterator over the elements of the array.
      java.util.ListIterator<CosObject> listIterator()
      Returns a list iterator over the elements of the array.
      CosObject remove​(int index)
      Removes the element at the specified position in this list.
      boolean remove​(CosObject cosObject)
      Removes all instances of the specified object from the array.
      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, java.lang.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, java.lang.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.
      • Methods inherited from class java.lang.Object

        getClass, hashCode, notify, notifyAll, wait, wait, wait