Class sunsoft.jws.visual.rt.type.ListParser
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sunsoft.jws.visual.rt.type.ListParser

java.lang.Object
   |
   +----sunsoft.jws.visual.rt.type.ListParser

public class ListParser
extends Object
Utility class for parsing lists of things in the style of Tcl.

Constructor Index

 o ListParser(String)
 o ListParser(String, int)
 o ListParser(String, int, int)

Method Index

 o elements()
 o getListElements(String, int)
 o indent(StringBuffer, int)
Indents "buf" based on the given indent level.
 o isdigit(char)
 o isxdigit(char)
 o list(String)
 o list(String, StringBuffer)
 o makeListTable(String)
 o newline()
Returns a string that can be used as a newline.
 o newline(StringBuffer)
Appends a newline to buf.
 o parseInt(String)
 o quote(char[], boolean)
Puts quotes around the given character array if it contains spaces or double-quotes.
 o quote(String, boolean)
 o quote(String, StringBuffer, boolean)
 o size()

Constructors

 o ListParser
  public ListParser(String str)
 o ListParser
  public ListParser(String str,
                    int offset)
 o ListParser
  public ListParser(String str,
                    int begin,
                    int end)

Methods

 o elements
  public Enumeration elements()
 o size
  public int size()
 o list
  public static String list(String string)
 o list
  public static void list(String string,
                          StringBuffer buf)
 o quote
  public static String quote(String string,
                             boolean forceQuotes)
 o quote
  public static void quote(String string,
                           StringBuffer buf,
                           boolean forceQuotes)
 o quote
  public static char[] quote(char src[],
                             boolean forceQuotes)
Puts quotes around the given character array if it contains spaces or double-quotes. Only part of the string buffer is quoted, determined by the "startIndex" argument. The substring of the buffer starting at "startIndex" and ending at the end of the buffer is quoted. This method operates on a string buffer instead of a string for improved performance. The "quote" method also does escaping. A backslash is placed in front of any double-quote or backslash in the string itself. Also, new-line characters are replaced with the characters \ and n Added argument: forceQuotes. If this is true, then always put quotes around the text (necessary for code generation). Also, replace the '\n' character with the string "\n".
 o newline
  public static String newline()
Returns a string that can be used as a newline. This string includes a carriage return if we are running on Windows.
 o newline
  public static void newline(StringBuffer buf)
Appends a newline to buf. This also appends a carriage return if we are running on Windows.
 o indent
  public static void indent(StringBuffer buf,
                            int indentLevel)
Indents "buf" based on the given indent level.
 o isdigit
  public static boolean isdigit(char ch)
 o isxdigit
  public static boolean isxdigit(char ch)
 o getListElements
  public static Enumeration getListElements(String s,
                                            int mult)
 o makeListTable
  public static Hashtable makeListTable(String s)
 o parseInt
  public static int parseInt(String s)

All Packages  Class Hierarchy  This Package  Previous  Next  Index