|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.ml.tigerxml.tools.StringTools
public class StringTools
Provides methods related to Strings. This class is for static use.
| Constructor Summary | |
|---|---|
StringTools()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
cleanXMLString(java.lang.String dirtyXMLString)
Cleans an XML String by translating special characters into XML entity references. |
java.lang.String |
formatBytes(int bytes)
Formats a given integer value interpreted as number of bytes to a String representing the value in bytes, KBs, MBs, GBs, or TBs. |
static void |
main(java.lang.String[] args)
|
static int |
minEditDistance(java.lang.String strA,
java.lang.String strB)
Computes the Minumum Edit Distance between two String objects. |
static java.util.ArrayList |
string2ArrayList(java.lang.String str)
Returns an ArrayList consisting of the single characters
(char) of the argument str. |
static void |
writeStringToFile(java.lang.String str,
java.lang.String fileName)
Writes a given String to a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringTools()
| Method Detail |
|---|
public static final java.lang.String cleanXMLString(java.lang.String dirtyXMLString)
dirtyXMLString - The XML String to be cleaned
public java.lang.String formatBytes(int bytes)
bytes - An integer representing a number of bytes.
bytes in bytes, KBs, MBs, GBs,
or TBs.public static final java.util.ArrayList string2ArrayList(java.lang.String str)
ArrayList consisting of the single characters
(char) of the argument str. Each character
is packed into a String object.
str - The String to be expanded.
ArrayList of String objects - one
String object for each character (char) of
the argument str.
public static final int minEditDistance(java.lang.String strA,
java.lang.String strB)
String objects.
The returned integer is the number of operations
(substitution, deletion or insertion) necessary to transform one
String to the other.
The Minimum Edit Distance has been used as a measure for similarity
between strings. For a detailed description of the algorithm see:
Robert A. Wagner and Michael J. Fischer. 1974.
strA - The first String.strB - The second String.
strA
into strB.
public static void writeStringToFile(java.lang.String str,
java.lang.String fileName)
String to a file.
fileName - The name of the file to be written.str - The String to be written.public static final void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||