public class OperatorCollection extends BaseOperatorCollection
Class represents collection of operators
Constructor and Description |
---|
OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents)
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.
|
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)
|
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. is this operators are inside of q - Q blocks
|
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
|
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 |
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.
|
isEmpty
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public OperatorCollection(com.aspose.pdf.engine.data.IPdfPrimitive contents)
Constructor of OperatorCollection. Constructs operators from primitive contains operators list.
contents
- IPdfPrimitive objectpublic boolean isReadOnly()
Gets a value indicating whether the collection is read-only.
isReadOnly
in class BaseOperatorCollection
public boolean isCommandsParsed()
Gets commands parsed
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 isFastTextExtractionMode()
Indicates wheather collection is limited to fast text extraction
isFastTextExtractionMode
in class BaseOperatorCollection
public com.aspose.ms.System.Collections.Generic.IGenericEnumerator<Operator> iterator()
Returns enumerator for collection
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 com.aspose.pdf.operators.q()); doc.getPages().get(1).getContents().add(new com.aspose.pdf.operators.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)
internal unrestricted version of Delete(index)
deleteUnrestricted
in class BaseOperatorCollection
index
- 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 BaseOperatorCollection
index
- 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 BaseOperatorCollection
index
- 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 BaseOperatorCollection
index
- int valuevalue
- Operator objectpublic Operator getUnrestricted(int index)
getUnrestricted
in class BaseOperatorCollection
index
- 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 BaseOperatorCollection
public 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 BaseOperatorCollection
public void resumeUpdate()
Resumes document update. Updates contents stream in case there are any pending changes.
resumeUpdate
in class BaseOperatorCollection
public void cancelUpdate()
Cancels last update. This method may be called when the change should not raise contents update.
cancelUpdate
in class BaseOperatorCollection
public com.aspose.ms.System.Collections.Generic.List<Operator> toList()
Returns operator list.
toList
in class BaseOperatorCollection
public boolean remove(Operator op)
Remove operator from the collection.
remove
in class BaseOperatorCollection
op
- Operator to be removed.public boolean contains(Operator op)
Returns true if the collection contains given operator.
contains
in class BaseOperatorCollection
op
- Operator instance