public class NetricsRecFile
extends java.lang.Object
implements java.io.Serializable
first,middle,last,order
5,5,5,6
William,Jefferson,Clinton,42
George,W,Bush,43
first,middle,last,order
5,5,5,6
key1,William,Jefferson,Clinton,42
key1,George,W,Bush,43
William,Jefferson,Clinton,42,key1
George,W,Bush,43,key2
first,middle,last,order,key
5,5,5,6,2
William,Jefferson,Clinton,42,key1
key1,George,W,Bush,43,key2
Constructor and Description |
---|
NetricsRecFile(java.lang.String fileName)
Define a default CSV file record source.
|
NetricsRecFile(java.lang.String fileName,
int keyIndex)
Define a default CSV file record source.
|
NetricsRecFile(java.lang.String fileName,
int[] fieldLengths,
java.lang.String encoding,
boolean doMaxWork,
boolean leadingKey,
int initialKey,
boolean fieldNamesFirst,
boolean fieldTypesFirst,
int keyIndex,
java.lang.String keyName)
Define a Fixed Width file record source.
|
NetricsRecFile(java.lang.String fileName,
java.lang.String encoding,
boolean doMaxWork,
boolean leadingKey,
int initialKey,
boolean fieldNamesFirst,
boolean fieldTypesFirst,
int keyIndex,
java.lang.String keyName)
Define a CSV file record source with attributes.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getDoMaxWork()
Return the Do Max Work setting.
|
java.lang.String |
getEncoding()
Return the value of character encoding setting.
|
boolean |
getFieldNamesFirst()
Return the state of the field names first setting.
|
boolean |
getFieldTypesFirst()
Return the state of the field types first setting.
|
java.lang.String |
getFileName()
Return the source file name.
|
int |
getInitialKey()
Return the initial key setting.
|
int |
getKeyIndex()
Return the value of the key index.
|
java.lang.String |
getKeyName()
Return the value of the key name.
|
boolean |
getLeadingKey()
Return the leading key setting.
|
void |
setDoMaxWork(boolean doMaxWork)
Set the Do Max Work (ignore errors) setting.
|
void |
setEncoding(java.lang.String encoding)
Set the character set encoding of the source file.
|
void |
setFieldNamesFirst(boolean fieldNamesFirst)
Set the field names first flag.
|
void |
setFieldTypesFirst(boolean fieldTypesFirst)
Set the state of the field types first flag.
|
void |
setFileName(java.lang.String fileName)
Set the source file name.
|
void |
setInitialKey(int initialKey)
Set the initial key value.
|
void |
setKeyIndex(int keyIndex)
Set the key index value.
|
void |
setKeyName(java.lang.String keyName)
Set the name of the field holding the record key.
|
void |
setLeadingKey(boolean leadingKey)
Set the leading key.
|
public NetricsRecFile(java.lang.String fileName) throws NetricsException
fileName
- The name of the file containing the records.NetricsException
- If an invalid or illegal combination
of values is given.public NetricsRecFile(java.lang.String fileName, int keyIndex) throws NetricsException
fileName
- The name of the file containing the records.keyIndex
- If this is non-negative it defines the index (0 based)
of the key field in the file records.NetricsException
- If an invalid or illegal combination
of values is given.public NetricsRecFile(java.lang.String fileName, java.lang.String encoding, boolean doMaxWork, boolean leadingKey, int initialKey, boolean fieldNamesFirst, boolean fieldTypesFirst, int keyIndex, java.lang.String keyName) throws NetricsException
fileName
- The name of the file containing the records.encoding
- This defines the character encoding used
in the file. Currently supported encodings are:
"UTF-8" or "LATIN1". DEFAULT: "LATIN1"doMaxWork
- Ignore badly formatted records.leadingKey
- This parameter is true if the file has the
Leading Key format.initialKey
- If the No Key format is used this defines
the initial key value for the generated keys. If this
is less than 0 the default value of 0 is used. Keys
are sequential numbers starting at the initial key.fieldNamesFirst
- If true the field names header line is
present in the file.fieldTypesFirst
- If true the field types header line is
present in the file.keyIndex
- If this is non-negative it defines the index (0 based)
of the key field in the file records.keyName
- If this is non-null it defines the name of the key
field in the file records and the file must contain
a field names header record and fieldNamesFirst
must be true.NetricsException
- If an invalid or illegal combination
of values is given.public NetricsRecFile(java.lang.String fileName, int[] fieldLengths, java.lang.String encoding, boolean doMaxWork, boolean leadingKey, int initialKey, boolean fieldNamesFirst, boolean fieldTypesFirst, int keyIndex, java.lang.String keyName) throws NetricsException
fileName
- The name of the file containing the records.fieldLengths
- This array contains the field widths in characters.
The length of the array must be the same as the number
of fields in the record, including and key field, even
if it is a leading key field.encoding
- This defines the character encoding used
in the file. Currently supported encodings are:
"UTF-8" or "LATIN1". DEFAULT: "LATIN1"doMaxWork
- Ignore badly formatted records.leadingKey
- This parameter is true if the file has the
Leading Key format.initialKey
- If the No Key format is used this defines
the initial key value for the generated keys. If this
is less than 0 the default value of 0 is used. Keys
are sequential numbers starting at the initial key.fieldNamesFirst
- If true the field names header line is
present in the file.fieldTypesFirst
- If true the field types header line is
present in the file.keyIndex
- If this is non-negative it defines the index (0 based)
of the key field in the file records.keyName
- If this is non-null it defines the name of the key
field in the file records and the file must contain
a field names header record and fieldNamesFirst
must be true.NetricsException
- If an invalid or illegal combination
of values is given.public java.lang.String getFileName()
public void setFileName(java.lang.String fileName)
public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
public boolean getDoMaxWork()
public void setDoMaxWork(boolean doMaxWork)
public boolean getLeadingKey()
public void setLeadingKey(boolean leadingKey)
public int getInitialKey()
public void setInitialKey(int initialKey)
public int getKeyIndex()
public void setKeyIndex(int keyIndex)
public java.lang.String getKeyName()
public void setKeyName(java.lang.String keyName)
public boolean getFieldNamesFirst()
public void setFieldNamesFirst(boolean fieldNamesFirst)
public boolean getFieldTypesFirst()
public void setFieldTypesFirst(boolean fieldTypesFirst)