All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class mesquite.lib.StringUtil

java.lang.Object
   |
   +----mesquite.lib.StringUtil

public class StringUtil
extends java.lang.Object
A set of static methods for Strings, independent of NEXUS parsing rules


Variable Index

 o argumentMarker
 o defaultPunctuation
 o defaultQuote
 o defaultWhitespace

Constructor Index

 o StringUtil()

Method Index

 o blank(FileBlock)
 o blank(String)
 o blank(String, String)
 o blank(StringBuffer)
 o closingSquareBracket(char)
 o delete(String, char)
replaces all instance of the old character by the nnew character
 o deTokenize(String)
 o getAllButLastItem(String, String)
returns everything in front of the last item in a string, separated into parts by the separator
 o getAllButLastItem(String, String, String)
returns everything in front of the last item in a string, separated into parts by whichever is last of the two separators
 o getLastItem(String, String)
returns the last item in a string, separated into parts by the separator
 o getLastItem(String, String, String)
returns the last item in a string, separated into parts by whichever is last of the two separators
 o getMaxCharWidth(Component)
 o getNumMatchingChars(String, char)
 o getStringCenterPosition(String, Graphics, int, int)
 o getStringDrawLength(Component, String)
 o getStringDrawLength(Graphics, String)
 o getStringVertPosition(Graphics, int, int)
 o getTextLineHeight(Component)
 o getTextLineHeight(Graphics)
 o hasPunctuation(String)
 o hasPunctuation(String, String)
 o hasSpecial(String)
 o highlightString(Graphics, String, int, int, Color, Color)
 o lineEndCharacter(char)
 o lineEnding()
 o openingSquareBracket(char)
 o pascalByteArrayFromString(String)
 o punctuation(char, String)
 o punctuationOrQuote(char, String, char)
 o removeCharacters(String, String)
 o removeLastCharacterIfMatch(String, char)
 o removeNewLines(String)
Removes all new line characters from the string.
 o replace(String, char, char)
replaces all instance of the old character by the nnew character
 o replace(String, String, String)
 o replaceFirst(String, String, String)
replaces first instance of the old substring by the nnew substring
 o stringFromPascalByteArray(byte[])
 o titled(String)
 o tokenize(String)
 o tokenize(String, String)
 o whitespace(char, String)

Variables

 o defaultWhitespace
 public static final java.lang.String defaultWhitespace
 o defaultPunctuation
 public static final java.lang.String defaultPunctuation
 o defaultQuote
 public static final char defaultQuote
 o argumentMarker
 public static final char argumentMarker

Constructors

 o StringUtil
 public StringUtil()

Methods

 o lineEnding
 public static java.lang.String lineEnding()
 o highlightString
 public static void highlightString(java.awt.Graphics g,
                                    java.lang.String s,
                                    int x,
                                    int y,
                                    java.awt.Color fore,
                                    java.awt.Color back)
 o delete
 public static java.lang.String delete(java.lang.String line,
                                       char old)
replaces all instance of the old character by the nnew character

 o replace
 public static java.lang.String replace(java.lang.String line,
                                        char old,
                                        char nnew)
replaces all instance of the old character by the nnew character

 o replace
 public static java.lang.String replace(java.lang.String s,
                                        java.lang.String from,
                                        java.lang.String to)
 o replaceFirst
 public static java.lang.String replaceFirst(java.lang.String line,
                                             java.lang.String old,
                                             java.lang.String nnew)
replaces first instance of the old substring by the nnew substring

 o getLastItem
 public static java.lang.String getLastItem(java.lang.String line,
                                            java.lang.String separator)
returns the last item in a string, separated into parts by the separator

 o getLastItem
 public static java.lang.String getLastItem(java.lang.String line,
                                            java.lang.String separator1,
                                            java.lang.String separator2)
returns the last item in a string, separated into parts by whichever is last of the two separators

 o getAllButLastItem
 public static java.lang.String getAllButLastItem(java.lang.String line,
                                                  java.lang.String separator)
returns everything in front of the last item in a string, separated into parts by the separator

 o getAllButLastItem
 public static java.lang.String getAllButLastItem(java.lang.String line,
                                                  java.lang.String separator1,
                                                  java.lang.String separator2)
returns everything in front of the last item in a string, separated into parts by whichever is last of the two separators

 o pascalByteArrayFromString
 public static byte[] pascalByteArrayFromString(java.lang.String s)
 o stringFromPascalByteArray
 public static java.lang.String stringFromPascalByteArray(byte nameBytes[])
 o getStringVertPosition
 public static int getStringVertPosition(java.awt.Graphics g,
                                         int top,
                                         int height)
 o getStringCenterPosition
 public static int getStringCenterPosition(java.lang.String s,
                                           java.awt.Graphics g,
                                           int left,
                                           int width)
 o getStringDrawLength
 public static int getStringDrawLength(java.awt.Graphics g,
                                       java.lang.String s)
 o getStringDrawLength
 public static int getStringDrawLength(java.awt.Component component,
                                       java.lang.String s)
 o getTextLineHeight
 public static int getTextLineHeight(java.awt.Graphics g)
 o getMaxCharWidth
 public static int getMaxCharWidth(java.awt.Component component)
 o getTextLineHeight
 public static int getTextLineHeight(java.awt.Component component)
 o titled
 public static boolean titled(java.lang.String line)
 o deTokenize
 public static java.lang.String deTokenize(java.lang.String token)
 o tokenize
 public static java.lang.String tokenize(java.lang.String token,
                                         java.lang.String punctuationString)
 o getNumMatchingChars
 public static int getNumMatchingChars(java.lang.String token,
                                       char c)
 o removeLastCharacterIfMatch
 public static java.lang.String removeLastCharacterIfMatch(java.lang.String token,
                                                           char c)
 o removeCharacters
 public static java.lang.String removeCharacters(java.lang.String token,
                                                 java.lang.String characters)
 o removeNewLines
 public static java.lang.String removeNewLines(java.lang.String line)
Removes all new line characters from the string.

 o tokenize
 public static java.lang.String tokenize(java.lang.String token)
 o hasPunctuation
 public static boolean hasPunctuation(java.lang.String token,
                                      java.lang.String punctuationString)
 o hasPunctuation
 public static boolean hasPunctuation(java.lang.String token)
 o hasSpecial
 public static boolean hasSpecial(java.lang.String token)
 o openingSquareBracket
 protected static boolean openingSquareBracket(char c)
 o closingSquareBracket
 protected static boolean closingSquareBracket(char c)
 o whitespace
 public static boolean whitespace(char c,
                                  java.lang.String whitespaceString)
 o punctuation
 public static boolean punctuation(char c,
                                   java.lang.String punctuationString)
 o punctuationOrQuote
 public static boolean punctuationOrQuote(char c,
                                          java.lang.String punctuationString,
                                          char quotechar)
 o lineEndCharacter
 public static boolean lineEndCharacter(char c)
 o blank
 public static boolean blank(java.lang.String line)
 o blank
 public static boolean blank(java.lang.String line,
                             java.lang.String temporaryWhiteSpace)
 o blank
 public static boolean blank(java.lang.StringBuffer line)
 o blank
 public static boolean blank(mesquite.lib.FileBlock line)

All Packages  Class Hierarchy  This Package  Previous  Next  Index