Ontimize 5.2072EN

com.ontimize.db.util
Class ImportTxt

java.lang.Object
  extended bycom.ontimize.db.util.ImportTxt

public abstract class ImportTxt
extends java.lang.Object

It make possible to read the information from a text file. Nowadays only text delimited by tabs is considered.

Version:
1.0

Nested Class Summary
static class ImportTxt.ExStringTokenizer
           
 
Field Summary
static java.lang.String LINE_SEPARATOR
           
 
Constructor Summary
ImportTxt()
           
 
Method Summary
protected static int countArchives(java.io.File f, java.io.FileFilter ff)
           
protected static int countLines(java.io.File f, java.io.FileFilter ff)
           
static java.util.Hashtable importDelimited(char del, char rowDelimiter, java.io.File f, boolean firstRowIsColumnNames, java.io.File fLog)
           
static java.util.Hashtable importDelimited(char del, char rowDelimiter, java.lang.String content, boolean firstRowIsColumnNames, java.io.File fLog)
           
static java.util.Hashtable importDelimited(char del, java.io.File f, boolean firstRowIsColumnNames, java.io.File fLog)
           
static java.util.Hashtable importTabDelimited(java.io.File f, boolean firstRowIsColumnNames)
           
static java.util.Hashtable importTabDelimited(java.io.File f, boolean firstRowIsColumnNames, java.io.File fLog)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINE_SEPARATOR

public static java.lang.String LINE_SEPARATOR
Constructor Detail

ImportTxt

public ImportTxt()
Method Detail

importTabDelimited

public static java.util.Hashtable importTabDelimited(java.io.File f,
                                                     boolean firstRowIsColumnNames)
                                              throws java.lang.IllegalArgumentException,
                                                     java.io.FileNotFoundException,
                                                     java.io.IOException
Parameters:
f -
firstRowIsColumnNames -
Returns:
A Hashtable object. If firstRowIsColumnNames is true keys are the first row values and in other case keys are integer values (1,2...). Hashtable values are Vector objects with values of each file column.
Throws:
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.io.IOException

importTabDelimited

public static java.util.Hashtable importTabDelimited(java.io.File f,
                                                     boolean firstRowIsColumnNames,
                                                     java.io.File fLog)
                                              throws java.lang.IllegalArgumentException,
                                                     java.io.FileNotFoundException,
                                                     java.io.IOException
Throws:
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.io.IOException

importDelimited

public static java.util.Hashtable importDelimited(char del,
                                                  char rowDelimiter,
                                                  java.lang.String content,
                                                  boolean firstRowIsColumnNames,
                                                  java.io.File fLog)
                                           throws java.lang.IllegalArgumentException,
                                                  java.io.FileNotFoundException,
                                                  java.io.IOException
Throws:
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.io.IOException

importDelimited

public static java.util.Hashtable importDelimited(char del,
                                                  char rowDelimiter,
                                                  java.io.File f,
                                                  boolean firstRowIsColumnNames,
                                                  java.io.File fLog)
                                           throws java.lang.IllegalArgumentException,
                                                  java.io.FileNotFoundException,
                                                  java.io.IOException
Throws:
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.io.IOException

importDelimited

public static java.util.Hashtable importDelimited(char del,
                                                  java.io.File f,
                                                  boolean firstRowIsColumnNames,
                                                  java.io.File fLog)
                                           throws java.lang.IllegalArgumentException,
                                                  java.io.FileNotFoundException,
                                                  java.io.IOException
Throws:
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

countLines

protected static int countLines(java.io.File f,
                                java.io.FileFilter ff)
                         throws java.lang.Exception
Throws:
java.lang.Exception

countArchives

protected static int countArchives(java.io.File f,
                                   java.io.FileFilter ff)
                            throws java.lang.Exception
Throws:
java.lang.Exception

Ontimize