org.problets.lib.conceptmap.state
Class Utility

java.lang.Object
  extended by org.problets.lib.conceptmap.state.Utility

public class Utility
extends java.lang.Object

Static method container class for commonly used utility methods

Since:
December 2003
Author:
Eric Fernades

Field Summary
static TextFormatter textFormatter
          The text formatter for mouseover drawing
 
Constructor Summary
Utility()
           
 
Method Summary
static java.util.Vector cloneAndRemoveFirst(java.util.Vector original)
          Creates a duplicate vector but removes the first element from the duplicate.
static java.util.Vector cloneAndRemoveLast(java.util.Vector original)
          Creates a duplicate vector but removes the last element from the duplicate.
static java.util.Vector convertTextToFullName(java.lang.String text)
          Converts an node full name in a text version (period-delimited) to a vector fomat (with each ancestor an element in the vector followed by the node name itself).
static boolean isTextNodeAnAnd(java.lang.String text)
          Given a node name in period-delimited text format, determines if the node is an AND by checking for a + before the last name in the string (the target node name).
static void main(java.lang.String[] args)
           
static java.lang.String prepareStringForTextFormatter(java.lang.String text)
          Given a string without special formatting, quotes any special characters.
static java.lang.String vector2String(java.util.Vector nameVector)
          Converts a node full name in vector fomat (with each ancestor an element in the vector followed by the node name itself) to a text version (period-delimited).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textFormatter

public static final TextFormatter textFormatter
The text formatter for mouseover drawing

Constructor Detail

Utility

public Utility()
Method Detail

cloneAndRemoveLast

public static java.util.Vector cloneAndRemoveLast(java.util.Vector original)
Creates a duplicate vector but removes the last element from the duplicate.

Parameters:
original - the vector to be cloned
Returns:
the cloned vector

cloneAndRemoveFirst

public static java.util.Vector cloneAndRemoveFirst(java.util.Vector original)
Creates a duplicate vector but removes the first element from the duplicate.

Parameters:
original - the vector to be cloned
Returns:
the cloned vector

vector2String

public static java.lang.String vector2String(java.util.Vector nameVector)
Converts a node full name in vector fomat (with each ancestor an element in the vector followed by the node name itself) to a text version (period-delimited).

Parameters:
nameVector - the name of the node in vector format
Returns:
the name of the node in text version

convertTextToFullName

public static java.util.Vector convertTextToFullName(java.lang.String text)
Converts an node full name in a text version (period-delimited) to a vector fomat (with each ancestor an element in the vector followed by the node name itself).

Parameters:
text - the name of the node in text version
Returns:
the name of the node in vector format

isTextNodeAnAnd

public static boolean isTextNodeAnAnd(java.lang.String text)
Given a node name in period-delimited text format, determines if the node is an AND by checking for a + before the last name in the string (the target node name).

Parameters:
text - the name of the node in text version
Returns:
true if the node is an AND, false otherwise

prepareStringForTextFormatter

public static java.lang.String prepareStringForTextFormatter(java.lang.String text)
Given a string without special formatting, quotes any special characters. For examplle, < is replaced with <<>. The returned string can be provided to the text formatter class.

Parameters:
text - the the "raw" string, without special formatting
Returns:
the string ready to be provided to the TextFormatter class

main

public static void main(java.lang.String[] args)