public final class OperatorCollection extends BaseOperatorCollection
Class represents collection of operators
Constructor and Description |
---|
OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents)
Constructor of OperatorCollection.
|
OperatorCollection(com.aspose.pdf.engine.data.ITrailerable trailerable,
com.aspose.pdf.engine.data.IPdfPrimitive contents)
Constructor of OperatorCollection.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(IOperatorSelector visitor)
Accepts IOperatorSelector visitor object to process operators.
|
void |
add(Iterable 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 |
copyTo(com.aspose.ms.System.Array array,
int index)
Copies operators into operators list.
|
void |
delete(int index)
Deletes operator from collection.
|
void |
delete(Iterable list)
Deletes operators from collection.
|
void |
delete(Operator[] ops)
Deletes operators from collection.
|
void |
deleteUnrestricted(int index)
internal unrestricted version of Delete(index)
|
Operator |
get_Item(int index)
Gets operator by its index.
|
com.aspose.ms.System.Collections.Generic.List<Operator> |
getCommands() |
Object |
getSyncRoot()
Gets synchronization object.
|
Operator |
getUnrestricted(int index)
Internal unrestricted version of indexer
|
void |
insert(int at,
Iterable 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. is this operators
are inside of q - Q blocks
|
boolean |
isFastTextExtractionMode()
Indicates wheather collection is limited to fast text extraction
|
boolean |
isSynchronized()
Returns true if object is synchronized.
|
com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Operator> |
iterator()
Returns enumerator for collection
|
void |
replace(Iterable operators)
Replace operators in collection with other operators.
|
void |
replace(Operator[] operators) |
void |
resumeUpdate()
Resumes document update.
|
void |
set_Item(int index,
Operator value)
Sets operator by its index.
|
void |
setData(com.aspose.pdf.engine.data.IPdfPrimitive data) |
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.
|
isEmpty
public OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents)
Constructor of OperatorCollection. Constructs operators from primitive contains operators list.
contents
- public OperatorCollection(com.aspose.pdf.engine.data.ITrailerable trailerable, com.aspose.pdf.engine.data.IPdfPrimitive contents)
trailerable
- contents
- public com.aspose.ms.System.Collections.Generic.List<Operator> getCommands()
public void setData(com.aspose.pdf.engine.data.IPdfPrimitive data)
public void updateData()
Update object stream.
updateData
in class BaseOperatorCollection
public int size()
Gets count of operators in the collection.
size
in class BaseOperatorCollection
public boolean isSynchronized()
Returns true if object is synchronized.
isSynchronized
in class BaseOperatorCollection
public boolean isFastTextExtractionMode()
Indicates wheather collection is limited to fast text extraction
isFastTextExtractionMode
in class BaseOperatorCollection
public Object getSyncRoot()
Gets synchronization object.
getSyncRoot
in class BaseOperatorCollection
public void copyTo(com.aspose.ms.System.Array array, int index)
Copies operators into operators list.
array
- Array with operators which must to be copied. This array must be Object[] or Operator[].index
- Starting index from which operators will be copiedpublic com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Operator> iterator()
Returns enumerator for collection
iterator
in interface com.aspose.ms.System.Collections.Generic.IGenericEnumerable<Operator>
iterator
in interface com.aspose.ms.System.Collections.IEnumerable<Operator>
iterator
in interface Iterable<Operator>
iterator
in class BaseOperatorCollection
public 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 Operator.q()); doc.getPages().get(1).getContents().add(new Operator.Q());
add
in class BaseOperatorCollection
op
- 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)
deleteUnrestricted
in class BaseOperatorCollection
index
- 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());
insert
in class BaseOperatorCollection
index
- Index where new operator must be addedop
- Operator which will be instertedpublic void replace(Iterable operators)
Replace operators in collection with other operators.
operators
- Operators list which will replace operators currently contained in the collection. Eash 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)
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() } );
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 Operator.q(), new Operator.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.
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);
get_Item
in class BaseOperatorCollection
index
- Index of operator. Numbering is starts from 1.public void set_Item(int index, Operator value)
BaseOperatorCollection
Sets operator by its index.
set_Item
in class BaseOperatorCollection
index
- Index of operator. Numbering is starts from 1.value
- Operator.public Operator getUnrestricted(int index)
getUnrestricted
in class BaseOperatorCollection
index
- 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] } );
ops
- Array of operators to deletepublic 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 opList = new ArrayList(); opList.add(oc[1]); oc.delete(opList);
list
- The list of operators to deletepublic void insert(int at, Iterable 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 opList = new ArrayList(); opList.add(new Operator.q()); opList.add(new Operator.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();
public String toString()
Returns text representation of the operator.
public void add(Iterable 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);
ops
- collection whitch 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()
suppressUpdate
in class BaseOperatorCollection
public void resumeUpdate()
resumeUpdate
in class BaseOperatorCollection
public void cancelUpdate()
cancelUpdate
in class BaseOperatorCollection
public com.aspose.ms.System.Collections.Generic.List<Operator> toList()
Returns operator list.
toList
in class BaseOperatorCollection
Copyright © 2017 Aspose. All Rights Reserved.