|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.ml.tigerxml.tools.GeneralTools
public class GeneralTools
Provides methods that might generally be useful when utilizing the org.jscience.ml.tigerxml. This class is for static use.
| Constructor Summary | |
|---|---|
GeneralTools()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
getTimeStamp()
Generate and return a string with current date and time. |
static java.lang.String |
map2String(java.util.Map map)
Converts a Map to a String. |
static java.lang.String |
map2String(java.util.Map map,
java.lang.String prefix)
Converts a Map to a String. |
static int |
minEditDistance(java.util.ArrayList listA,
java.util.ArrayList listB)
Compute the Minumum Edit Distance between two ArrayLists. |
protected static int |
minimum(int a,
int b,
int c)
Returns the minimum of three integer values. |
static java.util.ArrayList |
sortNodes(java.util.ArrayList unsortedNodes)
This static method accepts a list of GraphNodes and sorts it
according to linear precedence. |
static java.util.ArrayList |
sortTerminals(java.util.ArrayList unsortedTerminals)
Sorts a given list of Terminals according to linear precedence. |
static java.lang.String |
timeConvert(long time)
Converts a time value given in ms into minutes and seconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GeneralTools()
| Method Detail |
|---|
protected static int minimum(int a,
int b,
int c)
public static final java.util.ArrayList sortNodes(java.util.ArrayList unsortedNodes)
GraphNodes and sorts it
according to linear precedence.
In order to get a sorted copy of an ArrayList of Terminals
use #sortTerminals(ArrayListunsortedTerminals)
- Parameters:
unsortedNodes - The GraphNode ArrayList to be sorted.
public static final java.util.ArrayList sortTerminals(java.util.ArrayList unsortedTerminals)
ArrayList without touching the original
ArrayList.
unsortedTerminals - The ArrayList of terminal nodes to be sorted
public static final int minEditDistance(java.util.ArrayList listA,
java.util.ArrayList listB)
ArrayLists.
The returned integer is the number of operations
(substitution, deletion or insertion) necessary to transform one list to
the other. Note that the objects in the ArrayLists are
treated as identical if and only if they refer to the same object
(listA.get(i)==listB.get(j) has the value true).
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.
listA - The first ArrayList.listB - The second ArrayList.
listA
to listB.public static java.lang.String timeConvert(long time)
time - A numerical value (long) representing milliseconds.
public static final java.lang.String getTimeStamp()
String containing the current date and time.public static java.lang.String map2String(java.util.Map map)
Map to a String. Maps can be
AbstractMap, Attributes, HashMap, Hashtable, IdentityHashMap,
RenderingHints, TreeMap or WeakHashMap
map - The Map to be printed.
public static java.lang.String map2String(java.util.Map map,
java.lang.String prefix)
Map to a String. Maps can be
AbstractMap, Attributes, HashMap, Hashtable, IdentityHashMap,
RenderingHints, TreeMap or WeakHashMap. Use prefix
to add a String in front of each line.
map - The Map to be printed.prefix - A String preceding each line.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||