jPod PDF library

de.intarsys.pdf.content
Class CSOperation

java.lang.Object
  extended by de.intarsys.pdf.content.CSOperation
Direct Known Subclasses:
CSLiteral

public class CSOperation
extends Object

Represents the operations that make up a content stream.

The content stream is a sequence of operations, with any operation being a list of operands followed by the operator.


Field Summary
static COSName OPERAND_Tx
           
 
Constructor Summary
CSOperation(byte[] operatorToken, COSObject[] operands)
           
CSOperation(CSOperator operator)
           
CSOperation(CSOperator operator, COSObject[] operands)
           
 
Method Summary
 void addOperand(COSObject object)
          Add an operand at the end of the current operand list.
 Object getCache()
           
 COSObject getOperand(int i)
          The operand at index i.
 Iterator getOperands()
          The iterator over all operands.
 CSOperator getOperator()
          The operator of the operation.
 byte[] getOperatorToken()
           
 boolean hasOperator()
          Answer true if an operator is already defined.
 boolean isOpBeginMarkedContent(COSName mark)
          true if this is a "begin marked content" operation with the operand mark (or any operation when mark is null).
 boolean isOpEndMarkedContent()
          true if this is a "end marked content" operation.
 boolean matchesOperator(CSOperator other)
          Answer true if this operator's name matches the token other.
 int operandSize()
          Answer the number of operands.
 void setCache(Object cache)
           
 COSObject setOperand(int i, COSObject object)
          Set operand at index i to objec.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPERAND_Tx

public static final COSName OPERAND_Tx
Constructor Detail

CSOperation

public CSOperation(byte[] operatorToken,
                   COSObject[] operands)

CSOperation

public CSOperation(CSOperator operator)

CSOperation

public CSOperation(CSOperator operator,
                   COSObject[] operands)
Method Detail

addOperand

public void addOperand(COSObject object)
Add an operand at the end of the current operand list.

Parameters:
object - The new operand to add.

getCache

public Object getCache()

getOperand

public COSObject getOperand(int i)
The operand at index i.

Parameters:
i - The index of the perand in the operand's list.
Returns:
The operand at index i.

getOperands

public Iterator getOperands()
The iterator over all operands.

Returns:
The iterator over all operands.

getOperator

public CSOperator getOperator()
The operator of the operation.

Returns:
The operator of the operation.

getOperatorToken

public byte[] getOperatorToken()

hasOperator

public boolean hasOperator()
Answer true if an operator is already defined.

Returns:
Answer true if an operator is already defined.

isOpBeginMarkedContent

public boolean isOpBeginMarkedContent(COSName mark)
true if this is a "begin marked content" operation with the operand mark (or any operation when mark is null).

Parameters:
mark - The requested operand to the operation.
Returns:
true if this is a "begin marked content" operation with the operand mark.

isOpEndMarkedContent

public boolean isOpEndMarkedContent()
true if this is a "end marked content" operation.

Returns:
true if this is a "end marked content" operation

matchesOperator

public boolean matchesOperator(CSOperator other)
Answer true if this operator's name matches the token other.

Parameters:
other - token to check against the operators name.
Returns:
Answer true if this operator's name matches the token other.

operandSize

public int operandSize()
Answer the number of operands.

Returns:
the number of operands.

setCache

public void setCache(Object cache)

setOperand

public COSObject setOperand(int i,
                            COSObject object)
Set operand at index i to objec.

Parameters:
i - The index of the perand in the operand's list.
object - the operand object
Returns:
The previous operand at index i.

toString

public String toString()
Overrides:
toString in class Object

jPod PDF library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.