|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.io.FixedWidthTextTableSchema
public class FixedWidthTextTableSchema
Helper class that stores character length counts for each column in
a fixed width text table. This class is needed for reading and writing
fixed width data tables. A schema definition can either be created
manually using the addColumn(String, int)
method or loaded from
a tab-delimited text file using the load(String)
method.
Constructor Summary | |
---|---|
FixedWidthTextTableSchema()
Creates a new, initially empty FixedWidthTextTableSchema. |
Method Summary | |
---|---|
void |
addColumn(java.lang.String name,
int length)
Adds a column to this schema description. |
int |
getColumnCount()
Returns the number of columns in this schema. |
int |
getColumnEnd(int idx)
Sets the ending character number for the given column index. |
int |
getColumnLength(int idx)
Gets the character length of the given column |
java.lang.String |
getColumnName(int idx)
Gets the name of the requested column |
int |
getColumnStart(int idx)
Gets the starting character number for the given column index |
static FixedWidthTextTableSchema |
load(java.lang.String loc)
Loads a schema description from the given location. |
void |
write(java.io.OutputStream os)
Writes this schema description to the given output stream. |
void |
write(java.lang.String filename)
Writes this schema description to a file with the given name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FixedWidthTextTableSchema()
Method Detail |
---|
public void addColumn(java.lang.String name, int length)
name
- the name of this columnlength
- the length, in text characters, of this column in a data filepublic int getColumnCount()
public java.lang.String getColumnName(int idx)
idx
- the index of the column
public int getColumnLength(int idx)
idx
- the index of the column
public int getColumnStart(int idx)
idx
- the index of the column
public int getColumnEnd(int idx)
idx
- the index of the column
public void write(java.lang.String filename) throws DataIOException
filename
- the name of the file
DataIOException
- if an IO exception occurspublic void write(java.io.OutputStream os) throws DataIOException
os
- the output stream
DataIOException
- if an IO exception occurspublic static FixedWidthTextTableSchema load(java.lang.String loc) throws DataIOException
loc
- a location string representing a filename, URL, or resource locator
DataIOException
- if an IO exception occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |