public class CSVTableContainer<R,C,V> extends TableContainer<R,C,V>
| Constructor and Description |
|---|
CSVTableContainer() |
CSVTableContainer(Class<R> ROW_TYPE,
Class<C> COLUMN_TYPE,
Class<V> VALUE_TYPE) |
CSVTableContainer(String headerName) |
CSVTableContainer(String headerName,
Class<R> ROW_TYPE,
Class<C> COLUMN_TYPE,
Class<V> VALUE_TYPE) |
| Modifier and Type | Method and Description |
|---|---|
CSVTableContainer<R,C,V> |
load(@NotNull String path)
Load data from external storage into container.
|
String |
LOCAL_STORAGE_DIR()
Get local directory to store container.
|
String |
NEW_LINE()
Get the new line character used in csv format file.
|
CSVTableContainer<R,C,V> |
NEW_LINE(String NEW_LINE)
Set new line character.
|
void |
persist(@NotNull String path)
Persist container data to external permanent storage.
|
String |
SEPARATOR()
Get the separator used in csv format file.
|
CSVTableContainer<R,C,V> |
SEPARATOR(String SEPARATOR)
Set separator character.
|
CSVTableContainer<R,C,V> |
setColumnType(Class<C> COLUMN_TYPE) |
CSVTableContainer<R,C,V> |
setRowType(Class<R> ROW_TYPE) |
CSVTableContainer<R,C,V> |
setValueType(Class<V> VALUE_TYPE) |
clean, clone, columnKeys, columnMap, CONTAINER_COUNT, filter, get, getHeaderName, merge, NULL_CHARACTER_DISPLAY, NULL_CHARACTER_DISPLAY, print, print, push, rowKeys, rowMap, setHeaderName, singleColumn, singleRow, sortpublic CSVTableContainer()
public CSVTableContainer(String headerName)
public CSVTableContainer(Class<R> ROW_TYPE, Class<C> COLUMN_TYPE, Class<V> VALUE_TYPE)
@Contract(pure=true) public String SEPARATOR()
DEFAULT: |
@Contract(pure=true) public String NEW_LINE()
DEFAULT: \r\n
@Contract(pure=true) public String LOCAL_STORAGE_DIR()
public void persist(@NotNull
@NotNull String path)
throws DataPersistenceException
For different separators, set it through SEPARATOR(String).
For different new line character under different systems, set it through NEW_LINE(String).
The pattern for remote path is "user.password@host:port:path-to-file.csv".
e.g.
1. hadoop.123@master:22:~/csv-data/result.csv
2. hadoop@master:~/csv-data/result.csv (with no password and default port 22)
persist in class TableContainer<R,C,V>path - external storage pathDataPersistenceException - error appearance such as IOException and so onpublic CSVTableContainer<R,C,V> load(@NotNull @NotNull String path) throws DataLoadingException
Notice: set row, column and value types first before calling this method.
The three types of row, column and value, abbreviated as R, C and V,
are requested for supporting by PARSERS or implementing the
Parsable interface.
The pattern for remote path is "user.password@host:port:path-to-file.csv".
e.g.
1. hadoop.123@master:22:~/csv-data/result.csv
2. hadoop@master:~/csv-data/result.csv (with no password and default port 22)
load in class TableContainer<R,C,V>path - external storage pathDataLoadingException - error appearance such as IOException,
IllegalValueTypeException and so onpublic CSVTableContainer<R,C,V> SEPARATOR(String SEPARATOR)
SEPARATOR - separator characterpublic CSVTableContainer<R,C,V> NEW_LINE(String NEW_LINE)
NEW_LINE - new line characterCopyright © 2019. All rights reserved.