|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.pegacat.vcf.utility.Utility
Usefully thingumies that don't rate their own classes wind up in here...
Method Summary | |
static java.lang.String |
byte2Hex(byte b)
|
static java.lang.String |
bytes2Hex(byte[] bytes)
|
static void |
center(java.awt.Component centerMe,
java.awt.Component positioner)
This positions a component to the center of another component. |
static void |
centerOnScreen(java.awt.Component centerMe)
Centers the compenent on the screen |
static java.lang.String |
char2Hex(char c)
|
static java.awt.Frame |
getParentFrame(java.awt.Component c)
Iterates through a components parents until it finds the root frame. |
static int |
nextCharIn(int pos,
java.lang.String searchMe,
java.lang.String compare,
boolean match)
Get the next character pos in a string after an initial offset that either matches, or does not match, any of a set of comparison characters. |
static void |
printEnumeration(java.util.Enumeration e)
prints an enumeration... |
static java.lang.String[] |
readFilteredDirectory(java.lang.String dirPath,
java.lang.String extension)
Reads a directory, returning all file names of the given extension. |
static java.lang.String[] |
readFilteredDirectory(java.lang.String dirPath,
java.lang.String[] fileExtensions)
Reads a directory, returning all file names of the given extensions |
static java.lang.String |
readTextFile(java.io.File file)
Reads a text file, and returns the result as a StringBuffer. |
static java.lang.StringBuffer |
readURLText(java.net.URL url)
Returns the raw text (i.e. |
static java.lang.StringBuffer |
replaceAllBufferChar(java.lang.StringBuffer text,
char c,
java.lang.String replacement)
Deletes all characters c in text replaces it with the string replacement. |
static java.lang.StringBuffer |
replaceAllBufferString(java.lang.StringBuffer text,
java.lang.String orig,
java.lang.String replacement)
Deletes all characters c in text replaces it with the string replacement. |
static java.lang.String |
replaceAllChar(java.lang.StringBuffer text,
char c,
java.lang.String replacement)
Deletes all characters c in text replaces it with the string replacement. |
static java.lang.String |
replaceAllString(java.lang.StringBuffer text,
java.lang.String orig,
java.lang.String replacement)
Deletes all characters c in text replaces it with the string replacement. |
static int |
replaceChar(java.lang.StringBuffer text,
int pos,
java.lang.String replacement)
Deletes a character in text at position pos and replaces it with the string replacement. |
static int |
replaceString(java.lang.StringBuffer text,
int pos,
int len,
java.lang.String replacement)
Deletes a substring in text at position pos, of length len and replaces it with the string replacement. |
static java.lang.String |
string2Hex(java.lang.String orig)
|
static void |
writeTextFile(java.io.File file,
java.lang.String data)
Writes a String to a text file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.lang.StringBuffer readURLText(java.net.URL url) throws java.io.IOException
url
- the url of the web age to read as plain text.public static java.lang.String readTextFile(java.io.File file) throws java.io.IOException
file
- the ascii file to read from.public static void writeTextFile(java.io.File file, java.lang.String data) throws java.io.IOException
file
- the ascii file to read from.public static int replaceChar(java.lang.StringBuffer text, int pos, java.lang.String replacement)
text
- the text to be modifiedpos
- the position of the character to be deletedreplacement
- the string the character is to be replaced with.public static java.lang.String replaceAllChar(java.lang.StringBuffer text, char c, java.lang.String replacement)
text
- the text to be modifiedreplacement
- the string the character is to be replaced with.public static java.lang.StringBuffer replaceAllBufferChar(java.lang.StringBuffer text, char c, java.lang.String replacement)
text
- the text to be modifiedreplacement
- the string the character is to be replaced with.public static int replaceString(java.lang.StringBuffer text, int pos, int len, java.lang.String replacement)
text
- the text to be modifiedpos
- the position of the character to be deletedreplacement
- the string the character is to be replaced with.public static java.lang.String replaceAllString(java.lang.StringBuffer text, java.lang.String orig, java.lang.String replacement)
text
- the text to be modifiedreplacement
- the string the original substring is to be replaced with.public static java.lang.StringBuffer replaceAllBufferString(java.lang.StringBuffer text, java.lang.String orig, java.lang.String replacement)
text
- the text to be modifiedreplacement
- the string the character is to be replaced with.public static int nextCharIn(int pos, java.lang.String searchMe, java.lang.String compare, boolean match)
pos
- the position to start searching fromsearchMe
- the string to searchcompare
- a string containing characters to compare againstwhether
- the match is for characters in the compare string (true)
or not in the compare string (false)public static java.lang.String[] readFilteredDirectory(java.lang.String dirPath, java.lang.String extension)
dirPath
- directory to readextension
- the file extension to filter files with.public static java.lang.String[] readFilteredDirectory(java.lang.String dirPath, java.lang.String[] fileExtensions)
dirPath
- directory to readextension
- a list of file extensions to filter files with. A 'null' means 'a directory'
use an empty string for blank extension files).public static void printEnumeration(java.util.Enumeration e)
public static java.awt.Frame getParentFrame(java.awt.Component c)
public static void center(java.awt.Component centerMe, java.awt.Component positioner)
centreMe
- the component to centerpositioner
- the component used as the reference center.public static void centerOnScreen(java.awt.Component centerMe)
centerMe
- the awt derived component to center.public static java.lang.String bytes2Hex(byte[] bytes)
public static java.lang.String string2Hex(java.lang.String orig)
public static java.lang.String byte2Hex(byte b)
public static java.lang.String char2Hex(char c)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |