public final class ReplaceSpecification extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
ReplaceSpecification.Action
The action to take when a missing value is discovered within a field.
|
Constructor and Description |
---|
ReplaceSpecification()
Default public constructor.
|
Modifier and Type | Method and Description |
---|---|
static ReplaceSpecification |
constant(ScalarTokenType type,
String value)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_CONSTANT action
for fields with the specified type. |
static ReplaceSpecification |
constant(String fieldName,
String value)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_CONSTANT action
for the specified field. |
static ReplaceSpecification |
freq(ScalarTokenType type)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MOST_FREQ action
for fields with the specified type. |
static ReplaceSpecification |
freq(String fieldName)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MOST_FREQ action
for the specified field. |
ReplaceSpecification.Action |
getAction()
Get the replacement action value.
|
String |
getFieldName()
Get the field name.
|
ScalarTokenType |
getFieldType()
Get the field type.
|
String |
getReplacementValue()
Get the constant replacement value.
|
static ReplaceSpecification |
max(ScalarTokenType type)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MAX action
for fields with the specified type. |
static ReplaceSpecification |
max(String fieldName)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MAX action
for the specified field. |
static ReplaceSpecification |
mean(ScalarTokenType type)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MEAN action
for fields with the specified type. |
static ReplaceSpecification |
mean(String fieldName)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MEAN action
for the specified field. |
static ReplaceSpecification |
median(ScalarTokenType type)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MEDIAN action
for fields with the specified type. |
static ReplaceSpecification |
median(String fieldName)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MEDIAN action
for the specified field. |
static ReplaceSpecification |
min(ScalarTokenType type)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MIN action
for fields with the specified type. |
static ReplaceSpecification |
min(String fieldName)
Create a replacement specification with the
ReplaceSpecification.Action.REPLACE_MIN action
for the specified field. |
static ReplaceSpecification |
none(ScalarTokenType type)
Create a replacement specification with the
ReplaceSpecification.Action.NONE action
for fields with the specified type. |
static ReplaceSpecification |
none(String fieldName)
Create a replacement specification with the
ReplaceSpecification.Action.NONE action
for the specified field. |
void |
setAction(ReplaceSpecification.Action action)
Set the replacement
ReplaceSpecification.Action . |
void |
setFieldName(String fieldName)
Set the field name to apply the replacement action.
|
void |
setFieldType(ScalarTokenType fieldType)
Set the field (token) type.
|
void |
setReplacementValue(String replacementValue)
Set the replacement value.
|
static ReplaceSpecification |
skip(ScalarTokenType type)
Create a replacement specification with the
ReplaceSpecification.Action.SKIP_RECORD action
for fields with the specified type. |
static ReplaceSpecification |
skip(String fieldName)
Create a replacement specification with the
ReplaceSpecification.Action.SKIP_RECORD action
for the specified field. |
public static ReplaceSpecification none(String fieldName)
ReplaceSpecification.Action.NONE
action
for the specified field.fieldName
- apply the action to this fieldNONE
actionpublic static ReplaceSpecification none(ScalarTokenType type)
ReplaceSpecification.Action.NONE
action
for fields with the specified type.type
- apply the action to all fields of this typeNONE
actionpublic static ReplaceSpecification skip(String fieldName)
ReplaceSpecification.Action.SKIP_RECORD
action
for the specified field.fieldName
- apply the action to this fieldSKIP_RECORD
actionpublic static ReplaceSpecification skip(ScalarTokenType type)
ReplaceSpecification.Action.SKIP_RECORD
action
for fields with the specified type.type
- apply the action to all fields of this typeSKIP_RECORD
actionpublic static ReplaceSpecification constant(String fieldName, String value)
ReplaceSpecification.Action.REPLACE_CONSTANT
action
for the specified field.fieldName
- apply the action to this fieldvalue
- replacement valueREPLACE_CONSTANT
actionpublic static ReplaceSpecification constant(ScalarTokenType type, String value)
ReplaceSpecification.Action.REPLACE_CONSTANT
action
for fields with the specified type.type
- apply the action to all fields of this typevalue
- replacement valueREPLACE_CONSTANT
actionpublic static ReplaceSpecification min(String fieldName)
ReplaceSpecification.Action.REPLACE_MIN
action
for the specified field.fieldName
- apply the action to this fieldREPLACE_MIN
actionpublic static ReplaceSpecification min(ScalarTokenType type)
ReplaceSpecification.Action.REPLACE_MIN
action
for fields with the specified type.type
- apply the action to all fields of this typeREPLACE_MIN
actionpublic static ReplaceSpecification max(String fieldName)
ReplaceSpecification.Action.REPLACE_MAX
action
for the specified field.fieldName
- apply the action to this fieldREPLACE_MAX
actionpublic static ReplaceSpecification max(ScalarTokenType type)
ReplaceSpecification.Action.REPLACE_MAX
action
for fields with the specified type.type
- apply the action to all fields of this typeREPLACE_MAX
actionpublic static ReplaceSpecification median(String fieldName)
ReplaceSpecification.Action.REPLACE_MEDIAN
action
for the specified field.fieldName
- apply the action to this fieldREPLACE_MEDIAN
actionpublic static ReplaceSpecification median(ScalarTokenType type)
ReplaceSpecification.Action.REPLACE_MEDIAN
action
for fields with the specified type.type
- apply the action to all fields of this typeREPLACE_MEDIAN
actionpublic static ReplaceSpecification mean(String fieldName)
ReplaceSpecification.Action.REPLACE_MEAN
action
for the specified field.fieldName
- apply the action to this fieldREPLACE_MEAN
actionpublic static ReplaceSpecification mean(ScalarTokenType type)
ReplaceSpecification.Action.REPLACE_MEAN
action
for fields with the specified type.type
- apply the action to all fields of this typeREPLACE_MEAN
actionpublic static ReplaceSpecification freq(String fieldName)
ReplaceSpecification.Action.REPLACE_MOST_FREQ
action
for the specified field.fieldName
- apply the action to this fieldREPLACE_MOST_FREQ
actionpublic static ReplaceSpecification freq(ScalarTokenType type)
ReplaceSpecification.Action.REPLACE_MOST_FREQ
action
for fields with the specified type.type
- apply the action to all fields of this typeREPLACE_MOST_FREQ
actionpublic ReplaceSpecification.Action getAction()
public void setAction(ReplaceSpecification.Action action)
ReplaceSpecification.Action
.action
- the action to setpublic String getFieldName()
public void setFieldName(String fieldName)
fieldName
- the fieldName to setpublic ScalarTokenType getFieldType()
public void setFieldType(ScalarTokenType fieldType)
fieldType
- the fieldType to setpublic String getReplacementValue()
public void setReplacementValue(String replacementValue)
ReplaceSpecification.Action.REPLACE_CONSTANT
, ignored otherwise.replacementValue
- the replacementValue to setCopyright © 2019 Actian Corporation. All rights reserved.