org.extex.font.format.xtf.tables.cff
Class T2Operator

java.lang.Object
  extended by org.extex.font.format.xtf.tables.cff.T2CharString
      extended by org.extex.font.format.xtf.tables.cff.T2Operator
All Implemented Interfaces:
XMLWriterConvertible
Direct Known Subclasses:
T2Arithmetic, T2Conditional, T2Dummy, T2EndChar, T2FinishingPath, T2Hints, T2PathConstruction, T2Storage, T2Subroutine, T2TopDICTOperator

public abstract class T2Operator
extends T2CharString
implements XMLWriterConvertible

Operator.

Version:
$Revision: 6604 $
Author:
Michael Niedermair

Field Summary
 
Fields inherited from class org.extex.font.format.xtf.tables.cff.T2CharString
ESCAPE, ESCAPE_BYTE, T2CALLGSUBR, T2CALLSUBR, T2CNTRMASK, T2ENDCHAR, T2FLEX, T2FLEX1, T2HFLEX, T2HFLEX1, T2HHCURVETO, T2HINTMASK, T2HLINETO, T2HMOVETO, T2HSTEM, T2HSTEMHM, T2HVCURVETO, T2RCURVELINE, T2RETURN, T2RLINECURVE, T2RLINETO, T2RMOVETO, T2RRCURVETO, T2VHCURVETO, T2VLINETO, T2VMOVETO, T2VSTEM, T2VSTEMHM, T2VVCURVETO, TYPE_CALLGSUBR, TYPE_CALLSUBR, TYPE_CNTRMASK, TYPE_ENDCHAR, TYPE_FLEX, TYPE_FLEX1, TYPE_HFLEX, TYPE_HFLEX1, TYPE_HHCURVETO, TYPE_HINTMASK, TYPE_HLINETO, TYPE_HMOVETO, TYPE_HSTEM, TYPE_HSTEMHM, TYPE_HVCURVETO, TYPE_RCURVELINE, TYPE_RETURN, TYPE_RLINECURVE, TYPE_RLINETO, TYPE_RMOVETO, TYPE_RRCURVETO, TYPE_VHCURVETO, TYPE_VLINETO, TYPE_VMOVETO, TYPE_VSTEM, TYPE_VSTEMHM, TYPE_VVCURVETO
 
Constructor Summary
protected T2Operator()
          Create a new object.
 
Method Summary
protected  T2Number checkWidth(java.util.List<T2CharString> stack, CharString ch)
          Check, if a width is set.
protected  short[] convertStackaddID(java.util.List<? extends T2CharString> stack, short[] id)
          Convert a stack (a List) into an array and add at the top the id-array.
abstract  int getID()
          Returns the id of the operator.
abstract  java.lang.String getName()
          Return the name of the operator.
abstract  java.lang.Object getValue()
          Returns the value of the operator.
 void init(RandomAccessR rar, OtfTableCFF cff, int baseoffset, CffFont cffFont)
          Initialize.
 boolean isOperator()
          Check, if the object is an operator.
static T2Operator newInstance(RandomAccessR rar, CharString ch)
          Create a new instance.
 java.lang.String toString()
          
 java.lang.String toText()
          Returns a test string from the command.
 
Methods inherited from class org.extex.font.format.xtf.tables.cff.T2CharString
getBytes, getInitPrio, isArray, isBoolean, isDouble, isEscape, isInteger, isTopDICTOperator, readNumber, readNumber, readSID, readTopDICTOperator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.extex.util.xml.XMLWriterConvertible
writeXML
 

Constructor Detail

T2Operator

protected T2Operator()
Create a new object.

Method Detail

newInstance

public static T2Operator newInstance(RandomAccessR rar,
                                     CharString ch)
                              throws java.io.IOException
Create a new instance.

Parameters:
rar - the input
ch - The charstring
Returns:
Returns the new T2Operatorr object.
Throws:
java.io.IOException - if an IO-error occurs.

checkWidth

protected T2Number checkWidth(java.util.List<T2CharString> stack,
                              CharString ch)
                       throws T2MissingNumberException
Check, if a width is set.

The first stack-clearing operator, which must be one of hstem, hstemhm, vstem, vstemhm, cntrmask, hintmask, hmoveto, vmoveto, rmoveto, or endchar, takes an additional argument - the width (as described earlier), which may be expressed as zero or one numeric argument.

Parameters:
stack - The stack.
ch - The char string.
Returns:
Returns the with or null, if no exists.
Throws:
T2MissingNumberException - if a error occurred.

convertStackaddID

protected short[] convertStackaddID(java.util.List<? extends T2CharString> stack,
                                    short[] id)
Convert a stack (a List) into an array and add at the top the id-array.

Parameters:
stack - the stack
id - the id-array
Returns:
Return the byte-array

getID

public abstract int getID()
Returns the id of the operator.

Returns:
Returns the id of the operator.

getName

public abstract java.lang.String getName()
Return the name of the operator.

Returns:
Return the name of the operator.

getValue

public abstract java.lang.Object getValue()
Returns the value of the operator.

Returns:
Returns the value of the operator.

init

public void init(RandomAccessR rar,
                 OtfTableCFF cff,
                 int baseoffset,
                 CffFont cffFont)
          throws java.io.IOException
Initialize.

Specified by:
init in class T2CharString
Parameters:
rar - The input
cff - The cff table
baseoffset - The base offset from cff.
cffFont - The cff font.
Throws:
java.io.IOException - if an IO-error occurred.
See Also:
T2CharString.init( org.extex.util.file.random.RandomAccessR, org.extex.font.format.xtf.tables.OtfTableCFF, int, org.extex.font.format.xtf.tables.cff.CffFont)

isOperator

public boolean isOperator()
Check, if the object is an operator.

Overrides:
isOperator in class T2CharString
Returns:
Returns true, if the object is an operator.
See Also:
T2CharString.isOperator()

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

toText

public java.lang.String toText()
Returns a test string from the command.

Returns:
Returns a text string from the command.