public class OperatorCollection extends BaseOperatorCollection implements com.aspose.ms.System.IDisposable
Class represents collection of operators
| Constructor and Description |
|---|
OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents)
For internal usage only!
|
OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents,
com.aspose.pdf.engine.IOperatorContainer container)
For internal usage only!
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(IOperatorSelector visitor)
Accepts IOperatorSelector visitor object to process operators.
|
void |
add(Iterable<Operator> ops)
Adds to collection all operators from other collection.
|
void |
add(Operator op)
Adds new operator into collection.
|
void |
add(Operator[] ops)
Add operators at the end of the contents operators.
|
void |
cancelUpdate()
Cancels last update.
|
void |
clear()
Removes all operators from list.
|
void |
close()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
boolean |
contains(Operator op)
Returns true if the collection contains given operator.
|
void |
delete(int index)
Deletes operator from collection.
|
void |
delete(Iterable<Operator> list)
Deletes operators from collection.
|
void |
delete(Operator[] ops)
Deletes operators from collection.
|
void |
deleteUnrestricted(int index)
internal unrestricted version of Delete(index)
|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
Operator |
get_Item(int index)
Gets operator by its index.
|
Operator |
getUnrestricted(int index)
Internal unrestricted version of indexer
|
void |
insert(int at,
Iterable<Operator> ops)
Insert operators at the the given position.
|
void |
insert(int index,
Operator op)
Inserts operator into collection.
|
void |
insert(int at,
Operator[] ops)
Insert operators at the the given position.
|
boolean |
isBracketed()
Gets bracketed status of operator sequence i.e.
|
boolean |
isCommandsParsed()
Gets commands parsed
|
boolean |
isFastTextExtractionMode()
Indicates wheather collection is limited to fast text extraction
|
boolean |
isReadOnly()
Gets a value indicating whether the collection is read-only.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Operator> |
iterator()
Returns enumerator for collection
|
int |
precalculateOperatorsCount()
Get amount of operators that describe content for the page without initialisation of them.
|
boolean |
remove(Operator op)
Remove operator from the collection.
|
void |
replace(Iterable<Operator> operators)
Replace operators in collection with other operators.
|
void |
replace(Operator[] operators)
Replace operators in collection with other operators.
|
void |
resumeUpdate()
Resumes document update.
|
void |
resumeUpdate(boolean updateAll)
Resumes document update.
|
void |
set_Item(int index,
Operator value)
Sets operator by its index.
|
int |
size()
Gets count of operators in the collection.
|
void |
suppressUpdate()
Suppresses update contents data The contents stream is not updated until ResumeUpdate is
called
|
com.aspose.ms.System.Collections.Generic.List<Operator> |
toList()
Returns operator list.
|
String |
toString()
Returns text representation of the operator.
|
void |
updateData()
Update object stream.
|
void |
updateNormalizedData()
Update object stream with fixing absent GSave/GRestore operators.
|
isEmptyequals, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents)
Constructor of OperatorCollection. Constructs operators from primitive contains operators list.
contents - Primitive that contains operators.public OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents,
com.aspose.pdf.engine.IOperatorContainer container)
Constructor of OperatorCollection. Constructs operators from primitive contains operators list.
contents - Primitive that contains operators.container - Owner of this collection.public boolean isReadOnly()
Gets a value indicating whether the collection is read-only.
isReadOnly in class BaseOperatorCollectionpublic boolean isCommandsParsed()
Gets commands parsed
public void updateNormalizedData()
Update object stream with fixing absent GSave/GRestore operators.
public void updateData()
Update object stream.
updateData in class BaseOperatorCollectionpublic int size()
Gets count of operators in the collection.
size in class BaseOperatorCollectionpublic int precalculateOperatorsCount()
Get amount of operators that describe content for the page without initialisation of them.
public boolean isFastTextExtractionMode()
Indicates wheather collection is limited to fast text extraction
isFastTextExtractionMode in class BaseOperatorCollectionpublic com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Operator> iterator()
Returns enumerator for collection
iterator in interface Iterable<Operator>iterator in class BaseOperatorCollectionpublic void accept(IOperatorSelector visitor)
Accepts IOperatorSelector visitor object to process operators.
visitor - Visitor objectpublic 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 com.aspose.pdf.operators.q()); doc.getPages().get(1).getContents().add(new com.aspose.pdf.operators.Q());
add in class BaseOperatorCollectionop - Operator which must be addedpublic 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);
index - Index of operator which must be deleted. Operators numbering starts from 1.public void deleteUnrestricted(int index)
internal unrestricted version of Delete(index)
deleteUnrestricted in class BaseOperatorCollectionindex - int valuepublic 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 com.aspose.pdf.operators.q()); oc.add(new com.aspose.pdf.operators.Q());
insert in class BaseOperatorCollectionindex - Index where new operator must be addedop - Operator which will be insertedpublic void replace(Iterable<Operator> operators)
Replace operators in collection with other operators.
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 collectionpublic void replace(Operator[] operators)
Replace operators in collection with other operators.
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 collectionpublic 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 com.aspose.pdf.operators.q(), new com.aspose.pdf.operators.Q() } );
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.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 com.aspose.pdf.operators.q(), new com.aspose.pdf.operators.Q() } );
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.public Operator get_Item(int index)
Gets operator by its index.
Document doc = new Document("input.pdf");
OperatorCollection oc = doc.getPages().get(1).getContents();
Operator first = oc.get_Item(1);
get_Item in class BaseOperatorCollectionindex - Index of operator. Numbering is starts from 1.public void set_Item(int index,
Operator value)
Sets operator by its index.
set_Item in class BaseOperatorCollectionindex - int valuevalue - Operator objectpublic Operator getUnrestricted(int index)
getUnrestricted in class BaseOperatorCollectionindex - int valuepublic 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] } );
ops - Array of operators to deletepublic void delete(Iterable<Operator> list)
Deletes operators from collection.
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);
list - The list of operators to deletepublic void insert(int at,
Iterable<Operator> ops)
Insert operators at the the given position.
Document doc = new Document("input.pdf"); OperatorCollection oc = doc.getPages().get(1).getContents(); ArrayList<Operator> opList = new List<Operator>(); opList.add(new com.aspose.pdf.operators.q()); opList.add(new com.aspose.pdf.operators.Q()); oc.insert(1, opList);
at - Index from which operators are being started to insert.ops - Array of operators to be inserted.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();
clear in class BaseOperatorCollectionpublic String toString()
Returns text representation of the operator.
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 com.aspose.pdf.operators.q());
opList.add(new com.aspose.pdf.operators.Q());
oc.add(opList);
ops - collection which contains operators which will be added.public boolean isBracketed()
Gets bracketed status of operator sequence i.e. is this operators are inside of q - Q blocks
public void suppressUpdate()
Suppresses update contents data The contents stream is not updated until ResumeUpdate is called
suppressUpdate in class BaseOperatorCollectionpublic final void resumeUpdate(boolean updateAll)
Resumes document update. Updates contents stream in case there are any pending changes. Marks all operators as "changed" if invalidate parameter is true.
updateAll - If true, all operators in the collection marked as updated.public void resumeUpdate()
Resumes document update. Updates contents stream in case there are any pending changes.
resumeUpdate in class BaseOperatorCollectionpublic void cancelUpdate()
Cancels last update. This method may be called when the change should not raise contents update.
cancelUpdate in class BaseOperatorCollectionpublic com.aspose.ms.System.Collections.Generic.List<Operator> toList()
Returns operator list.
toList in class BaseOperatorCollectionpublic boolean remove(Operator op)
Remove operator from the collection.
remove in class BaseOperatorCollectionop - Operator to be removed.public boolean contains(Operator op)
Returns true if the collection contains given operator.
contains in class BaseOperatorCollectionop - Operator instancepublic final void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose in interface com.aspose.ms.System.IDisposablepublic final void close()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Copyright © 2025 Aspose. All Rights Reserved.