ru.zorin.pictfont
Class Parser

java.lang.Object
  extended by ru.zorin.pictfont.Parser

public class Parser
extends java.lang.Object

Class Parser is used for parsing text file with font description.


Constructor Summary
Parser(java.io.Reader reader)
          Creates a new instance of Parser
 
Method Summary
 int readFields(java.lang.StringBuffer[] fields)
          Reads from file next line with set of delimited field
 int readPair(java.lang.StringBuffer key, java.lang.StringBuffer value)
          Reads from file next line with pair (key=value)
static void trimQuote(java.lang.StringBuffer buff)
          Trims quotes from the string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parser

public Parser(java.io.Reader reader)
Creates a new instance of Parser

Method Detail

readPair

public int readPair(java.lang.StringBuffer key,
                    java.lang.StringBuffer value)
Reads from file next line with pair (key=value)

Parameters:
key - this buffer will be filled with key
value - this buffer will be filled with value
Returns:
0 - succesful; -1 - succesful and End Of File was be reached; -2 - failed.

readFields

public int readFields(java.lang.StringBuffer[] fields)
Reads from file next line with set of delimited field

Parameters:
fields - this array of buffer will be filled with corresponded values
Returns:
0 - succesful; -1 - succesful and End Of File was be reached; -2 - failed.

trimQuote

public static void trimQuote(java.lang.StringBuffer buff)
Trims quotes from the string