anl.aida.util
Class AIDAUtils

java.lang.Object
  extended by anl.aida.util.AIDAUtils

public class AIDAUtils
extends java.lang.Object

General static utility methods.


Field Summary
private static java.text.SimpleDateFormat longFormat
           
private static java.text.SimpleDateFormat shortFormat
           
 
Constructor Summary
AIDAUtils()
           
 
Method Summary
static java.lang.String formatDate(java.util.Date date)
          Formats the specified data in long format "MMMMM dd, yyyy HH:mm:ss z".
static java.lang.String formatShortDate(java.util.Date date)
          Formats the specified data in short format "MM/dd/yyyy".
static java.util.Date getDate(java.lang.String strDate)
          Gets a date for the specified string.
static java.util.Map<java.lang.String,java.lang.String> loadMap(java.lang.String fileName, java.lang.String delimiter)
          Creates a hash map from the specified file.
static java.lang.String toInternalFormat(java.lang.String term)
          Converts a term to the internal format used by AIDA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shortFormat

private static java.text.SimpleDateFormat shortFormat

longFormat

private static java.text.SimpleDateFormat longFormat
Constructor Detail

AIDAUtils

public AIDAUtils()
Method Detail

formatDate

public static java.lang.String formatDate(java.util.Date date)
Formats the specified data in long format "MMMMM dd, yyyy HH:mm:ss z".

Parameters:
date - the date to format
Returns:
the formatted date

formatShortDate

public static java.lang.String formatShortDate(java.util.Date date)
Formats the specified data in short format "MM/dd/yyyy".

Parameters:
date - the date to format
Returns:
the formatted date

toInternalFormat

public static java.lang.String toInternalFormat(java.lang.String term)
Converts a term to the internal format used by AIDA. For now this just lowercases the term.

Parameters:
term - the term to convert.
Returns:
the converted term.

getDate

public static java.util.Date getDate(java.lang.String strDate)
Gets a date for the specified string. The format must be YYYYMMDD.

Parameters:
strDate - the date in YYYYMMDD
Returns:
the created Date object.

loadMap

public static java.util.Map<java.lang.String,java.lang.String> loadMap(java.lang.String fileName,
                                                                       java.lang.String delimiter)
                                                                throws java.io.IOException
Creates a hash map from the specified file. Each line is processed such that everything to left of the delimiter becomes the key and everything to right becomes the value. This WILL NOT distinguish between a delimiter embedded in key (escaped or otherwise) and the true delimiter.

Parameters:
fileName -
delimiter -
Returns:
Throws:
java.io.IOException