org.pdfbox.pdmodel.common.function
Class PDDictionaryFunction

java.lang.Object
  extended byorg.pdfbox.pdmodel.common.function.PDFunction
      extended byorg.pdfbox.pdmodel.common.function.PDDictionaryFunction
All Implemented Interfaces:
COSObjectable
Direct Known Subclasses:
PDFunctionType2, PDFunctionType3

public abstract class PDDictionaryFunction
extends PDFunction

This class represents a function in a PDF document.

Version:
$Revision: 1.3 $
Author:
Ben Litchfield

Constructor Summary
  PDDictionaryFunction(COSDictionary functionDictionary)
          Constructor.
protected PDDictionaryFunction(int functionType)
          Constructor to create a new blank function, should only be called by subclasses.
 
Method Summary
 COSDictionary getCOSDictionary()
          Get the underlying cos dictionary.
 COSBase getCOSObject()
          Convert this standard java object to a COS object.
 PDRange getDomainForInput(int n)
          This will get the range for a certain input parameter. This is will never return null. If it is not present then the range 0 to 0 will be returned.
 int getNumberOfInputParameters()
          This will get the number of input parameters that have a domain specified.
 int getNumberOfOutputParameters()
          This will get the number of output parameters that have a range specified. A range for output parameters is optional so this may return zero for a function that does have output parameters, this will simply return the number that have the rnage specified.
 PDRange getRangeForOutput(int n)
          This will get the range for a certain output parameters. This is will never return null. If it is not present then the range 0 to 0 will be returned.
 void setDomainForInput(PDRange range, int n)
          This will set the domain for the input values.
 void setRangeForOutput(PDRange range, int n)
          This will set the a range for output parameter.
 
Methods inherited from class org.pdfbox.pdmodel.common.function.PDFunction
create
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDDictionaryFunction

protected PDDictionaryFunction(int functionType)
Constructor to create a new blank function, should only be called by subclasses.

Parameters:
functionType - An integer describing the function type, only 0,2,3,4 are defined by the PDF sepc.

PDDictionaryFunction

public PDDictionaryFunction(COSDictionary functionDictionary)
Constructor.

Parameters:
functionDictionary - The prepopulated function dictionary.
Method Detail

getCOSObject

public COSBase getCOSObject()
Convert this standard java object to a COS object.

Returns:
The cos object that matches this Java object.

getCOSDictionary

public COSDictionary getCOSDictionary()
Get the underlying cos dictionary.

Returns:
The underlying cos dictionary.

getNumberOfOutputParameters

public int getNumberOfOutputParameters()
This will get the number of output parameters that have a range specified. A range for output parameters is optional so this may return zero for a function that does have output parameters, this will simply return the number that have the rnage specified.

Specified by:
getNumberOfOutputParameters in class PDFunction
Returns:
The number of input parameters that have a range specified.

getRangeForOutput

public PDRange getRangeForOutput(int n)
This will get the range for a certain output parameters. This is will never return null. If it is not present then the range 0 to 0 will be returned.

Specified by:
getRangeForOutput in class PDFunction
Parameters:
n - The output parameter number to get the range for.
Returns:
The range for this component.

setRangeForOutput

public void setRangeForOutput(PDRange range,
                              int n)
This will set the a range for output parameter.

Specified by:
setRangeForOutput in class PDFunction
Parameters:
range - The new range for the output parameter.
n - The ouput parameter number to set the range for.

getNumberOfInputParameters

public int getNumberOfInputParameters()
This will get the number of input parameters that have a domain specified.

Specified by:
getNumberOfInputParameters in class PDFunction
Returns:
The number of input parameters that have a domain specified.

getDomainForInput

public PDRange getDomainForInput(int n)
This will get the range for a certain input parameter. This is will never return null. If it is not present then the range 0 to 0 will be returned.

Specified by:
getDomainForInput in class PDFunction
Parameters:
n - The parameter number to get the domain for.
Returns:
The domain range for this component.

setDomainForInput

public void setDomainForInput(PDRange range,
                              int n)
This will set the domain for the input values.

Specified by:
setDomainForInput in class PDFunction
Parameters:
range - The new range for the input.
n - The number of the input parameter to set the domain for.