com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class OperatorCollection

  • All Implemented Interfaces:
    com.aspose.ms.System.Collections.Generic.IGenericEnumerable<Operator>, com.aspose.ms.System.Collections.IEnumerable<Operator>, Iterable<Operator>


    public class OperatorCollection
    extends BaseOperatorCollection

    Class represents collection of operators

    • Method Detail

      • isCommandsParsed

        public boolean isCommandsParsed()

        Gets commands parsed

        Returns:
        boolean value
      • size

        public int size()

        Gets count of operators in the collection.

        Specified by:
        size in class BaseOperatorCollection
        Returns:
        int value
      • isFastTextExtractionMode

        public boolean isFastTextExtractionMode()

        Indicates wheather collection is limited to fast text extraction

        Specified by:
        isFastTextExtractionMode in class BaseOperatorCollection
        Returns:
        boolean value
      • iterator

        public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Operator> iterator()

        Returns enumerator for collection

        Specified by:
        iterator in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<Operator>
        Specified by:
        iterator in interface com.aspose.ms.System.Collections.IEnumerable<Operator>
        Specified by:
        iterator in interface Iterable<Operator>
        Specified by:
        iterator in class BaseOperatorCollection
        Returns:
        Collection enumerator
      • accept

        public void accept(IOperatorSelector visitor)

        Accepts IOperatorSelector visitor object to process operators.

        Parameters:
        visitor - Visitor object
      • add

        public void add(Operator op)

        Adds new operator into collection.


        Example demonstrates how to add operators to the end of page.contents. Document doc = new Document("input.pdf"); doc.getPages().get(1).getContents().add(new Operator.q()); doc.getPages().get(1).getContents().add(new Operator.Q());

        Specified by:
        add in class BaseOperatorCollection
        Parameters:
        op - Operator which must be added
      • delete

        public void delete(int index)

        Deletes operator from collection.


        Example demonstrates how to delete operator by its index. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages(1).getContents(); oc.delete(3);

        Parameters:
        index - Index of operator which must be deleted. Operators numbering starts from 1.
      • deleteUnrestricted

        public void deleteUnrestricted(int index)

        internal unrestricted version of Delete(index)

        Specified by:
        deleteUnrestricted in class BaseOperatorCollection
        Parameters:
        index - int value
      • insert

        public void insert(int index,
                  Operator op)

        Inserts operator into collection.


        Example demonstrates how to insert operator to the page contents. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages(1).getContents(); oc.insert(1, new Operator.q()); oc.add(new Operator.Q());

        Specified by:
        insert in class BaseOperatorCollection
        Parameters:
        index - Index where new operator must be added
        op - Operator which will be inserted
      • replace

        public void replace(Iterable<Operator> operators)

        Replace operators in collection with other operators.

        Parameters:
        operators - Operators list which will replace operators currently contained in the collection. Each operator from the list must have correct index in range [1..N] where N is count of operators in the collection
      • replace

        public void replace(Operator[] operators)

        Replace operators in collection with other operators.

        Parameters:
        operators - Operator[] array which will replace operators currently contained in the collection. Each operator from the list must have correct index in range [1..N] where N is count of operators in the collection
      • add

        public void add(Operator[] ops)

        Add operators at the end of the contents operators.


        Example demonstrates how to add operator to the end of page contents. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages().get(1).getContents(); oc.add(new Operator[] { new Operator.q(), new Operator.Q() } );

        Parameters:
        ops - Array of operators to be added. Each operator can have any index (by default -1) because they come to the end of the contents operators i.e. indices are assigned automatically.
      • insert

        public void insert(int at,
                  Operator[] ops)

        Insert operators at the the given position.


        Example demonstrates how to insert operator to the page contents. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages().get(1).getContents(); oc.insert(1, new Operator[] { new Operator.q(), new Operator.Q() } );

        Parameters:
        at - Index from which operators are being started to insert.
        ops - Array of operators to be inserted. Each operator can have any index (by default -1) because their indices adjusted automatically starting from at.
      • get_Item

        public Operator get_Item(int index)

        Gets operator by its index.


        Example demonstrates how to get operator of page contents by index. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages().get(1).getContents(); Operator first = oc.get_Item(1);

        Specified by:
        get_Item in class BaseOperatorCollection
        Parameters:
        index - Index of operator. Numbering is starts from 1.
        Returns:
        Operator from requested index
      • set_Item

        public void set_Item(int index,
                    Operator value)

        Sets operator by its index.

        Specified by:
        set_Item in class BaseOperatorCollection
        Parameters:
        index - int value
        value - Operator object
      • delete

        public void delete(Operator[] ops)

        Deletes operators from collection.


        Example demonstrates how to remove operator from page contents. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages().get(1).getContents(); oc.delete(new Operator[] { oc[1] } );

        Parameters:
        ops - Array of operators to delete
      • delete

        public void delete(Iterable list)

        Deletes operators from collection.


        Example demonstrates how to remove operator from page contents. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages().get(1).getContents(); ArrayList<Operator> opList = new ArrayList<Operator>(); opList.add(oc[1]); oc.delete(opList);

        Parameters:
        list - The list of operators to delete
      • insert

        public void insert(int at,
                  Iterable<Operator> ops)

        Insert operators at the the given position.


        Example demonstrates how to insert operators to page contents. Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages().get(1).getContents(); ArrayList<Operator> opList = new List<Operator>(); opList.add(new Operator.q()); opList.add(new Operator.Q()); oc.insert(1, opList);

        Parameters:
        at - Index from which operators are being started to insert.
        ops - Array of operators to be inserted.
      • clear

        public void clear()

        Removes all operators from list.


        Example demonstrates how to clear page contents. Document doc = new Document("input.pdf"); doc.getPages().get(1).clear();

      • toString

        public String toString()

        Returns text representation of the operator.

        Overrides:
        toString in class Object
        Returns:
        Text representation of operator.
      • add

        public void add(Iterable<Operator> ops)

        Adds to collection all operators from other collection.


         Example demonstrates how to add operator collection to the page contents.
         
         Document doc = new Document("input.pdf");
         OperatorCollection oc = doc.getPages(1).getContents();
         ArrayList opList = new ArrayList();
         opList.add(new Operator.q());
         opList.add(new Operator.Q());
         oc.add(opList);
         
        Parameters:
        ops - collection whitch contains operators which will be added.
      • isBracketed

        public boolean isBracketed()

        Gets bracketed status of operator sequence i.e. is this operators are inside of q - Q blocks

        Returns:
        boolean value
      • suppressUpdate

        public void suppressUpdate()

        Suppresses update contents data The contents stream is not updated until ResumeUpdate is called

        Specified by:
        suppressUpdate in class BaseOperatorCollection
      • resumeUpdate

        public void resumeUpdate()

        Resumes document update. Updates contents stream in case there are any pending changes.

        Specified by:
        resumeUpdate in class BaseOperatorCollection
      • cancelUpdate

        public void cancelUpdate()

        Cancels last update. This method may be called when the change should not raise contents update.

        Specified by:
        cancelUpdate in class BaseOperatorCollection
      • toList

        public com.aspose.ms.System.Collections.Generic.List<Operator> toList()

        Returns operator list.

        Specified by:
        toList in class BaseOperatorCollection
        Returns:
        operator list.