public class FixedWidthTextTableSchema
extends java.lang.Object
addColumn(String, int)
method or loaded from
a tab-delimited text file using the load(String)
method.Constructor and Description |
---|
FixedWidthTextTableSchema()
Creates a new, initially empty FixedWidthTextTableSchema.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public FixedWidthTextTableSchema()
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 columnpublic int getColumnLength(int idx)
idx
- the index of the columnpublic int getColumnStart(int idx)
idx
- the index of the columnpublic int getColumnEnd(int idx)
idx
- the index of the columnpublic void write(java.lang.String filename) throws DataIOException
filename
- the name of the fileDataIOException
- if an IO exception occurspublic void write(java.io.OutputStream os) throws DataIOException
os
- the output streamDataIOException
- if an IO exception occurspublic static FixedWidthTextTableSchema load(java.lang.String loc) throws DataIOException
loc
- a location string representing a filename, URL, or resource locatorDataIOException
- if an IO exception occursCopyright ? 2013 Regents of the University of California