|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simoes.util.StringUtil
Utility class for manipulating Strings in Java that I have found useful.
Constructor Summary | |
StringUtil()
|
Method Summary | |
static java.lang.String |
checkYOrN(java.lang.String str)
|
static java.lang.String |
constructURL(java.lang.String webpage,
java.util.Properties params)
Creates a URL from the passed in parameters. |
static java.lang.String |
containsAnyStrings(java.lang.String data,
java.util.ArrayList matches)
Returns true if the String data contains any of the Strings contained in the ArrayList. |
static java.lang.String |
containsOnlyString(java.lang.String data,
java.util.ArrayList matches,
boolean ignoreCase)
Returns true if the String data exactly matches one of the strings in contained in the ArrayList matches. |
static java.lang.String |
createFixedLengthString(java.lang.String s,
int length)
Constructs a String of the fixed length given. |
static java.util.Vector |
getLines(java.lang.String multiLine)
Creates a Vector of lines parsed on newline characters. |
static boolean |
isEmpty(java.lang.String str)
|
static void |
main(java.lang.String[] args)
|
static java.lang.String |
map2String(java.util.Map map)
Converts the Map passed in to a string containing "key=value" pairs separated by \n characters. |
static java.lang.String |
null2Empty(java.lang.String str)
Returns an empty string "" if str is null. |
static java.util.Vector |
parseCommand(byte[] command)
Creates a Vector of byte[] from the command passed in. |
static java.util.Vector |
parsePrintFileName(java.lang.String header)
This parses the "name" field passed in the header of the control file or the data files. |
static java.lang.String |
replaceString(java.lang.String line,
java.lang.String replace,
java.lang.String replaceWith)
Replaces the "replace" String with the "replaceWith" String in the "line" String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringUtil()
Method Detail |
public static java.util.Vector parseCommand(byte[] command)
command
- the bytes read in from the lpr client
public static java.util.Vector parsePrintFileName(java.lang.String header)
public static java.lang.String replaceString(java.lang.String line, java.lang.String replace, java.lang.String replaceWith)
line
- - String operated onreplace
- - text we will be replacingreplaceWith
- - text that will be substituted for "replace" text.
public static java.lang.String map2String(java.util.Map map)
public static java.lang.String containsAnyStrings(java.lang.String data, java.util.ArrayList matches)
data
- - A string that we will searchmatches
- - An ArrayList that contains only Strings. We will search
data to see if any of the Strings in matches are found in data.
public static java.lang.String containsOnlyString(java.lang.String data, java.util.ArrayList matches, boolean ignoreCase)
data
- - A string that we will searchmatches
- - An ArrayList that contains only Strings. We will search
data to see if any of the Strings in matches are found in data.ignoreCase
- - true = ignore case when comparing
public static java.lang.String null2Empty(java.lang.String str)
public static boolean isEmpty(java.lang.String str)
public static java.lang.String checkYOrN(java.lang.String str)
public static java.lang.String constructURL(java.lang.String webpage, java.util.Properties params)
webpage
- - the destination we are headed toparams
- - the parameters we append to the Destination, note the order
of these parameters is random
public static java.util.Vector getLines(java.lang.String multiLine)
public static java.lang.String createFixedLengthString(java.lang.String s, int length)
s
- - string to operate onlength
- - desired length
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |