LightweightOperatorCollection

Inheritance: java.lang.Object, com.aspose.pdf.BaseOperatorCollection

public class LightweightOperatorCollection extends BaseOperatorCollection

Lightweight operator collection. Intended to be used in scenarios when underlying contents stream is not attached, where just operator collection is required as a result.

Constructors

ConstructorDescription
LightweightOperatorCollection()Initialize object
LightweightOperatorCollection(ITrailerable trailerable, System.Collections.Generic.List operators)For internal usage only!
LightweightOperatorCollection(OperatorCollection operatorCollection)Initialize object

Methods

MethodDescription
get_Item(int index)Gets operator by its index.
set_Item(int index, Operator value)Sets operator by its index.
iterator()Return iterator
size()Operators count
isFastTextExtractionMode()Indicates whether collection is limited to fast text extraction
suppressUpdate()Suppresses update contents data.
resumeUpdate()Resumes document update.
insert(int index, Operator op)Insert operator
add(Operator op)Add operator
addRange(LightweightOperatorCollection oc)Add LightweightOperatorCollection
getUnrestricted(int index)For internal usage getUnrestricted operator
updateData()internal
deleteUnrestricted(int index)internal delete Unrestrictedelement
cancelUpdate()Cancels last update.
toList()Returns operators list.
remove(Operator item)
contains(Operator item)
clear()
isReadOnly()Gets a value indicating whether the collection is read-only.

LightweightOperatorCollection()

public LightweightOperatorCollection()

Initialize object

LightweightOperatorCollection(ITrailerable trailerable, System.Collections.Generic.List operators)

public LightweightOperatorCollection(ITrailerable trailerable, System.Collections.Generic.List<Operator> operators)

For internal usage only!

Parameters:

ParameterTypeDescription
trailerableITrailerableInternal object
operatorscom.aspose.ms.System.Collections.Generic.List<com.aspose.pdf.Operator>Internal object

LightweightOperatorCollection(OperatorCollection operatorCollection)

public LightweightOperatorCollection(OperatorCollection operatorCollection)

Initialize object

Parameters:

ParameterTypeDescription
operatorCollectionOperatorCollectionOperatorCollection object

get_Item(int index)

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_Item(1).getContents();
 Operator first = oc.get_Item(1);

Parameters:

ParameterTypeDescription
indexintIndex of operator. Numbering is starts from 1.

Returns: Operator - Operator from requested index

set_Item(int index, Operator value)

public void set_Item(int index, Operator value)

Sets 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_Item(1).getContents();
 Operator first = oc.get_Item(1);

Parameters:

ParameterTypeDescription
indexintIndex of operator. Numbering is starts from 1.
valueOperatorOperator from requested index

iterator()

public Iterator<Operator> iterator()

Return iterator

Returns: java.util.Iterator<com.aspose.pdf.Operator> - IGenericEnumerator object

size()

public int size()

Operators count

Returns: int - int value

isFastTextExtractionMode()

public boolean isFastTextExtractionMode()

Indicates whether collection is limited to fast text extraction

Returns: boolean - boolean value

suppressUpdate()

public void suppressUpdate()

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

resumeUpdate()

public void resumeUpdate()

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

insert(int index, Operator op)

public void insert(int index, Operator op)

Insert operator

Parameters:

ParameterTypeDescription
indexintint value
opOperatorOperator object

add(Operator op)

public void add(Operator op)

Add operator

Parameters:

ParameterTypeDescription
opOperatorOperator object

addRange(LightweightOperatorCollection oc)

public void addRange(LightweightOperatorCollection oc)

Add LightweightOperatorCollection

Parameters:

ParameterTypeDescription
ocLightweightOperatorCollectionLightweightOperatorCollection instance

getUnrestricted(int index)

public Operator getUnrestricted(int index)

For internal usage getUnrestricted operator

Parameters:

ParameterTypeDescription
indexintint value

Returns: Operator - Operator object

updateData()

public void updateData()

internal

deleteUnrestricted(int index)

public void deleteUnrestricted(int index)

internal delete Unrestrictedelement

Parameters:

ParameterTypeDescription
indexintint value

cancelUpdate()

public void cancelUpdate()

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

toList()

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

Returns operators list.

Returns: com.aspose.ms.System.Collections.Generic.List<com.aspose.pdf.Operator> - operators list.

remove(Operator item)

public boolean remove(Operator item)

Removes operator from collection.

Parameters:

ParameterTypeDescription
itemOperatorOperator instance

Returns: boolean - boolean value

contains(Operator item)

public boolean contains(Operator item)

Check if the item is in collection.

Parameters:

ParameterTypeDescription
itemOperatorOperator instance

Returns: boolean - boolean value

clear()

public void clear()

Clears collection.

isReadOnly()

public boolean isReadOnly()

Gets a value indicating whether the collection is read-only.

Returns: boolean