Class AddUserFields.AttributeSpec
java.lang.Object
weka.filters.unsupervised.attribute.AddUserFields.AttributeSpec
- All Implemented Interfaces:
Serializable
- Enclosing class:
- AddUserFields
Inner class encapsulating a new user-specified attribute to create.
- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Constructor Summary
ConstructorDescriptionDefault constructorAttributeSpec
(String spec) Constructor that takes an attribute specification in internal format -
Method Summary
Modifier and TypeMethodDescriptionGet the date formatting string (if any)Get the value of the attribute as a date or null if the attribute isn't of type date.getName()
Get the name of the new attributeGet the value of the attribute as a string (nominal and string attribute) or null if the attribute is not nominal or stringdouble
Get the value of the attribute as a number or Utils.missingValue() if the attribute is not numeric.Get the name of the attribute after substituting any environment variablesGet the type of the attribute after substituting any environment variablesGet the value of the attribute after substituting any environment variablesgetType()
Get the type of the new attributegetValue()
Get the value of the new attribute.void
init
(Environment env) Initialize this attribute spec by resolving any environment variables and setting up the date format (if necessary)void
Set the name of the new attributevoid
Set the type of the new attributevoid
Set the value of the new attribute.toString()
Return a nicely formatted string for display
-
Constructor Details
-
AttributeSpec
public AttributeSpec()Default constructor -
AttributeSpec
Constructor that takes an attribute specification in internal format- Parameters:
spec
- the attribute spec to use
-
-
Method Details
-
setName
Set the name of the new attribute- Parameters:
name
- the name of the new attribute
-
getName
Get the name of the new attribute- Returns:
- the name of the new attribute
-
setType
Set the type of the new attribute- Parameters:
type
- the type of the new attribute
-
getType
Get the type of the new attribute- Returns:
- the type of the new attribute
-
setValue
Set the value of the new attribute. Date attributes can assume a supplied date value (parseable by either the default date format or a user specified one) or the current time stamp if the user specifies the special string "now".- Parameters:
value
- the value of the new attribute
-
getValue
Get the value of the new attribute. Date attributes can assume a supplied date value (parseable by either the default date format or a user specified one) or the current time stamp if the user specifies the special string "now".- Returns:
- the value of the new attribute
-
getResolvedName
Get the name of the attribute after substituting any environment variables- Returns:
- the name of the attribute after environment variables have been substituted
-
getResolvedValue
Get the value of the attribute after substituting any environment variables- Returns:
- the value of the attribute after environment variables have been substituted
-
getResolvedType
Get the type of the attribute after substituting any environment variables- Returns:
- the tyep of the attribute after environment variables have been substituted
-
getDateFormat
Get the date formatting string (if any)- Returns:
- the date formatting string
-
getDateValue
Get the value of the attribute as a date or null if the attribute isn't of type date.- Returns:
- the value as a date
-
getNumericValue
public double getNumericValue()Get the value of the attribute as a number or Utils.missingValue() if the attribute is not numeric.- Returns:
- the value of the attribute as a number
-
getNominalOrStringValue
Get the value of the attribute as a string (nominal and string attribute) or null if the attribute is not nominal or string- Returns:
- the value of the attribute as a string
-
init
Initialize this attribute spec by resolving any environment variables and setting up the date format (if necessary)- Parameters:
env
- environment variables to use
-
toString
Return a nicely formatted string for display -
toStringInternal
-