Class AddUserFields.AttributeSpec
- java.lang.Object
-
- weka.filters.unsupervised.attribute.AddUserFields.AttributeSpec
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- AddUserFields
public static class AddUserFields.AttributeSpec extends java.lang.Object implements java.io.SerializableInner class encapsulating a new user-specified attribute to create.- Author:
- Mark Hall (mhall{[at]}pentaho{[dot]}com)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttributeSpec()Default constructorAttributeSpec(java.lang.String spec)Constructor that takes an attribute specification in internal format
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDateFormat()Get the date formatting string (if any)java.util.DategetDateValue()Get the value of the attribute as a date or null if the attribute isn't of type date.java.lang.StringgetName()Get the name of the new attributejava.lang.StringgetNominalOrStringValue()Get the value of the attribute as a string (nominal and string attribute) or null if the attribute is not nominal or stringdoublegetNumericValue()Get the value of the attribute as a number or Utils.missingValue() if the attribute is not numeric.java.lang.StringgetResolvedName()Get the name of the attribute after substituting any environment variablesjava.lang.StringgetResolvedType()Get the type of the attribute after substituting any environment variablesjava.lang.StringgetResolvedValue()Get the value of the attribute after substituting any environment variablesjava.lang.StringgetType()Get the type of the new attributejava.lang.StringgetValue()Get the value of the new attribute.voidinit(Environment env)Initialize this attribute spec by resolving any environment variables and setting up the date format (if necessary)voidsetName(java.lang.String name)Set the name of the new attributevoidsetType(java.lang.String type)Set the type of the new attributevoidsetValue(java.lang.String value)Set the value of the new attribute.java.lang.StringtoString()Return a nicely formatted string for displayjava.lang.StringtoStringInternal()
-
-
-
Method Detail
-
setName
public void setName(java.lang.String name)
Set the name of the new attribute- Parameters:
name- the name of the new attribute
-
getName
public java.lang.String getName()
Get the name of the new attribute- Returns:
- the name of the new attribute
-
setType
public void setType(java.lang.String type)
Set the type of the new attribute- Parameters:
type- the type of the new attribute
-
getType
public java.lang.String getType()
Get the type of the new attribute- Returns:
- the type of the new attribute
-
setValue
public void setValue(java.lang.String value)
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
public java.lang.String 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
public java.lang.String 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
public java.lang.String 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
public java.lang.String 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
public java.lang.String getDateFormat()
Get the date formatting string (if any)- Returns:
- the date formatting string
-
getDateValue
public java.util.Date 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
public java.lang.String 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
public void init(Environment env)
Initialize this attribute spec by resolving any environment variables and setting up the date format (if necessary)- Parameters:
env- environment variables to use
-
toString
public java.lang.String toString()
Return a nicely formatted string for display- Overrides:
toStringin classjava.lang.Object- Returns:
- a textual description
-
toStringInternal
public java.lang.String toStringInternal()
-
-