JLogView_.utils
Class LGUtils

java.lang.Object
  extended by JLogView_.utils.LGUtils

public class LGUtils
extends java.lang.Object

LGUtils is a class that contains all sorts of useful static methods. It is static so that you can call the methods from anywhere without having to instantiate the object.


Constructor Summary
LGUtils()
           
 
Method Summary
static LGTable[] extractAll(java.lang.String[] store)
          This is core parsing function to read all markup definitions.
static java.lang.Object mergeArrays(java.lang.Object old, java.lang.Object toadd)
          This methods merge two array together, by appending one to the other.
static LGTable readDatFile(java.io.File dat)
          This is the main parsing function to read a CCP4 dat file.
static LGTable[] readLogFile(java.io.File log)
          This is the main parsing function to read a CCP4 log file.
static LGTable readXmgrFile(java.io.File xmgr)
          This methods is meant to read xmgr format, currently it does nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LGUtils

public LGUtils()
Method Detail

mergeArrays

public static java.lang.Object mergeArrays(java.lang.Object old,
                                           java.lang.Object toadd)
This methods merge two array together, by appending one to the other. The arrays can be from any kind of type of object, the type only need to be casted on the return value when being called. The object type has to be the same for both arrays obviously. This method is useful because you do not need to care of the size of your arrays to merge them into a bigger one or to simply added elements one by one into an array without prior knowledge of how many elements there will be in the array.

Parameters:
old - one of the two array of Objects, may be null
toadd - the other of the two array of Objects, may be null
Returns:
one array containing all the entries of the two arrays given as input.
See Also:
Object

readLogFile

public static LGTable[] readLogFile(java.io.File log)
This is the main parsing function to read a CCP4 log file. It will parse the file, separate Table definition from the rest of the log file and extract all Tables information and store them into LGTable objects.

Parameters:
log - a File object representing the log File being read
Returns:
an array of LGTable object containing the information of each table found in the log file
See Also:
LGTable, File

extractAll

public static LGTable[] extractAll(java.lang.String[] store)
This is core parsing function to read all markup definitions. This is used both by the standalone and by the Applet.

Parameters:
store - an array of String containing only the useful lines from the log file
Returns:
an array of LGTable object containing the information of each table found in the log file
See Also:
LGTable, File

readXmgrFile

public static LGTable readXmgrFile(java.io.File xmgr)
This methods is meant to read xmgr format, currently it does nothing.


readDatFile

public static LGTable readDatFile(java.io.File dat)
This is the main parsing function to read a CCP4 dat file. It will parse the file. All table names will be "Unnamed table", all graphs will be calld "Unnamed graph", and the column names will be "Column_i"

Parameters:
dat - a File object representing the dat File being read
Returns:
one LGTable object containing the information of the table
See Also:
LGTable, File