org.apache.fop.fonts.type1

## Class PostscriptParser.PSElement

- java.lang.Object
- - org.apache.fop.fonts.type1.PostscriptParser.PSElement

Direct Known Subclasses:
  PostscriptParser.PSDictionary, PostscriptParser.PSFixedArray, PostscriptParser.PSSubroutine, PostscriptParser.PSVariable, PostscriptParser.PSVariableArray

Enclosing class:
  PostscriptParser

    public abstract class PostscriptParser.PSElement
    extends Object

A base Postscript element class

### Field Summary

Fields
`protected LinkedHashMap<String,int[]>` `binaryEntries`
`protected int` `endPoint`
`protected boolean` `hasMore`
`protected String` `operator`
`protected boolean` `readBinary`
`protected List<String>` `tokens`

### Constructor Summary

Constructors
Constructor and Description
`PSElement(String operator, int startPoint)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`LinkedHashMap<String,int[]>` `getBinaryEntries()`
`int[]` `getBinaryEntryByIndex(int index)` Gets the binary entry location of a given index from the array
`int` `getEndPoint()` The end location of the element within the source binary data
`boolean` `getFoundUnexpected()` Returns whether unexpected postscript has been found in the element
`String` `getOperator()` Gets the Postscript element operator
`int` `getStartPoint()` The start location of the element within the source binary data
`boolean` `hasMore()` Determines if more data is still to be parsed for the Postscript element.
`protected boolean` `isInteger(String intValue)`
`void` `parse(byte cur, int pos)` Takes over the task of tokenizing the byte data
`abstract void` `parseByte(byte cur, int pos)` Passes responsibility for processing the byte stream to the PostScript object
`abstract void` `parseToken(String token, int curPos)` Delegates the parse routine to a sub class
`protected void` `setFoundUnexpected(boolean foundUnexpected)` Sets a value to be true if an expected entry postscript is found in the element.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### operator

    protected String operator

#### hasMore

    protected boolean hasMore

#### binaryEntries

    protected LinkedHashMap<String,int[]> binaryEntries

#### tokens

    protected List<String> tokens

#### readBinary

    protected boolean readBinary

#### endPoint

    protected int endPoint

### Constructor Detail

#### PSElement

    public PSElement(String operator,
                     int startPoint)

### Method Detail

#### getOperator

    public String getOperator()

Gets the Postscript element operator

Returns:
  The operator returned as a string

#### getStartPoint

    public int getStartPoint()

The start location of the element within the source binary data

Returns:
  The start location returned as an integer

#### getEndPoint

    public int getEndPoint()

The end location of the element within the source binary data

Returns:
  The end location returned as an integer

#### parse

    public void parse(byte cur,
                      int pos)
               throws UnsupportedEncodingException

Takes over the task of tokenizing the byte data

Parameters:
  `cur` - The current byte being read
Throws:
  `UnsupportedEncodingException`

#### parseByte

    public abstract void parseByte(byte cur,
                                   int pos)

Passes responsibility for processing the byte stream to the PostScript object

Parameters:
  `cur` - The byte currently being read
  `pos` - The position of the given byte

#### parseToken

    public abstract void parseToken(String token,
                                    int curPos)

Delegates the parse routine to a sub class

Parameters:
  `token` - The token which to parse

#### isInteger

    protected boolean isInteger(String intValue)

#### getBinaryEntries

    public LinkedHashMap<String,int[]> getBinaryEntries()

#### getBinaryEntryByIndex

    public int[] getBinaryEntryByIndex(int index)

Gets the binary entry location of a given index from the array

Parameters:
  `index` - The index for which to retrieve the binary data location
Returns:

#### hasMore

    public boolean hasMore()

Determines if more data is still to be parsed for the Postscript element.

Returns:
  Returns true if more data exists

#### setFoundUnexpected

    protected void setFoundUnexpected(boolean foundUnexpected)

Sets a value to be true if an expected entry postscript is found in the element. An example is where the encoding table may have a series of postscript operators altering the state of the array. In this case the only option will be to fully embed the font to avoid incorrect encoding in the resulting subset.

Parameters:
  `foundUnexpected` - true if unexpected postscript is found.

#### getFoundUnexpected

    public boolean getFoundUnexpected()

Returns whether unexpected postscript has been found in the element

Returns:
  true if unexpected postscript is found