Package com.ibm.wala.util.tables
Class StringTable
- java.lang.Object
-
- com.ibm.wala.util.tables.Table<java.lang.String>
-
- com.ibm.wala.util.tables.StringTable
-
- All Implemented Interfaces:
java.lang.Cloneable
public class StringTable extends Table<java.lang.String> implements java.lang.Cloneable
-
-
Field Summary
-
Fields inherited from class com.ibm.wala.util.tables.Table
columnHeadings, rows
-
-
Constructor Summary
Constructors Constructor Description StringTable()
create an empty tableStringTable(StringTable t)
create an empty table with the same column headings as tStringTable(java.lang.String[] columns)
create an empty table with the given column headings
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
static StringTable
readFromDirectTextFile(java.lang.String fileName, java.lang.Character comment)
read from a direct (native) text filestatic StringTable
readFromStream(java.io.InputStream s, java.lang.Character commentToken)
static StringTable
readFromStream(java.io.InputStream s, java.lang.Character commentToken, java.lang.Character delimiter)
static StringTable
readFromTextFile(java.io.File f, java.lang.Character comment)
static java.lang.String
readNextNonCommentLine(java.io.LineNumberReader reader, java.lang.Character commentToken)
-
Methods inherited from class com.ibm.wala.util.tables.Table
addRow, computeColumnWidths, getColumnHeading, getElement, getNumberOfColumns, getNumberOfRows, padWithSpaces, removeRow, row2Map, toString
-
-
-
-
Constructor Detail
-
StringTable
public StringTable()
create an empty table
-
StringTable
public StringTable(StringTable t)
create an empty table with the same column headings as t
-
StringTable
public StringTable(java.lang.String[] columns)
create an empty table with the given column headings
-
-
Method Detail
-
readFromDirectTextFile
public static StringTable readFromDirectTextFile(java.lang.String fileName, java.lang.Character comment) throws java.io.FileNotFoundException, java.io.IOException
read from a direct (native) text file- Throws:
java.lang.IllegalArgumentException
- if fileName is nulljava.io.FileNotFoundException
java.io.IOException
-
readFromTextFile
public static StringTable readFromTextFile(java.io.File f, java.lang.Character comment) throws java.io.FileNotFoundException, java.io.IOException
- Parameters:
f
- a file containing a table in text format, whitespace delimited- Throws:
java.io.FileNotFoundException
java.io.IOException
-
readFromStream
public static StringTable readFromStream(java.io.InputStream s, java.lang.Character commentToken) throws java.io.IOException
- Parameters:
s
- a stream containing a table in text format, whitespace delimited- Throws:
java.lang.IllegalArgumentException
- if s is nulljava.io.IOException
-
readFromStream
public static StringTable readFromStream(java.io.InputStream s, java.lang.Character commentToken, java.lang.Character delimiter) throws java.io.IOException
- Parameters:
s
- a stream containing a table in text format, whitespace delimited- Throws:
java.lang.IllegalArgumentException
- if s is nulljava.io.IOException
-
readNextNonCommentLine
public static java.lang.String readNextNonCommentLine(java.io.LineNumberReader reader, java.lang.Character commentToken) throws java.io.IOException
- Throws:
java.io.IOException
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
-