public class NetricsRecFile
extends java.lang.Object
implements java.io.Serializable
first,middle,last,order
5,5,5,INT
William,Jefferson,Clinton,42
George,W,Bush,43
first,middle,last,order
srchtext,srchtext,srchtext,integer
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
SEARCHTEXT,SEARCHTEXT,SEARCHTEXT,INTEGER,KEY
William,Jefferson,Clinton,42,key1
key1,George,W,Bush,43,key2
key,first,middle,last,parent-key
Key,5,5,5,ParentKey
c1,Chelsea,Victoria,Clinton,key1
c1,Jenna,Bush,Hager,key2
c2,Barbara,Pierce,Bush,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.
|
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,
int parentKeyIndex,
java.lang.String parentKeyName)
Define a CSV file record source with attributes.
|
NetricsRecFile(java.lang.String fileName,
java.lang.String keyName,
java.lang.String parentKeyName)
Define a default CSV file record source.
|
| 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.
|
int |
getParentKeyIndex()
Return the value of the parent key index.
|
java.lang.String |
getParentKeyName()
Return the value of the parent key name.
|
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.
|
void |
setParentKeyIndex(int parentKeyIndex)
Set the parent key index value.
|
void |
setParentKeyName(java.lang.String parentKeyName)
Set the name of the field holding the record parent 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,
java.lang.String keyName,
java.lang.String parentKeyName)
throws NetricsException
fileName - The name of the file containing the records.keyName - Specifies the name of the field that holds record
key values in the file. Optional. If specified,
the file must contain a field names header record
and fieldNamesFirst must be true.parentKeyName - Specifies the name of the field that holds
record parent key values in the file. Optional. If
specified, 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 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,
int parentKeyIndex,
java.lang.String parentKeyName)
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.parentKeyIndex - If this is non-negative it defines the index (0 based)
of the parent key field in the file records.parentKeyName - If this is non-null it defines the name of the parent 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,
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)
fileName - the name of a CSV or fixed-width file.public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
encoding - a character set encoding name.public boolean getDoMaxWork()
public void setDoMaxWork(boolean doMaxWork)
doMaxWork - true to ignore badly formatted records.public boolean getLeadingKey()
public void setLeadingKey(boolean leadingKey)
leadingKey - pass true if the file has the Leading Key format.public int getInitialKey()
public void setInitialKey(int initialKey)
initialKey - NetricsRecFile(String, String, boolean, boolean,
int, boolean, boolean, int, String, int, String)public int getKeyIndex()
public void setKeyIndex(int keyIndex)
keyIndex - new value of the key index.java.lang.IllegalStateException - thrown if key is already specified by namepublic java.lang.String getKeyName()
public void setKeyName(java.lang.String keyName)
keyName - new value for the key name.java.lang.IllegalStateException - thrown if key is already specified by indexpublic int getParentKeyIndex()
public void setParentKeyIndex(int parentKeyIndex)
parentKeyIndex - new value of the parent key index.java.lang.IllegalStateException - thrown if parent key is already specified by namepublic java.lang.String getParentKeyName()
public void setParentKeyName(java.lang.String parentKeyName)
parentKeyName - new value of the parent key name.java.lang.IllegalStateException - thrown if parent key is already specified by indexpublic boolean getFieldNamesFirst()
public void setFieldNamesFirst(boolean fieldNamesFirst)
fieldNamesFirst - new value for the field-names-first flag.public boolean getFieldTypesFirst()
public void setFieldTypesFirst(boolean fieldTypesFirst)
fieldTypesFirst - new value for the field-types-first flag.