Package weka.filters.unsupervised.attribute

# Class AddUserFields.AttributeSpec

java.lang.Object
weka.filters.unsupervised.attribute.AddUserFields.AttributeSpec

All Implemented Interfaces:
  `Serializable`

Enclosing class:
  AddUserFields

public static class AddUserFields.AttributeSpec extends Object implements Serializable
Inner 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 constructor
  `AttributeSpec(String spec)`
  Constructor that takes an attribute specification in internal format

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDateFormat()`
  Get the date formatting string (if any)
  `Date`
  `getDateValue()`
  Get the value of the attribute as a date or null if the attribute isn't of type date.
  `String`
  `getName()`
  Get the name of the new attribute
  `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
  `double`
  `getNumericValue()`
  Get the value of the attribute as a number or Utils.missingValue() if the attribute is not numeric.
  `String`
  `getResolvedName()`
  Get the name of the attribute after substituting any environment variables
  `String`
  `getResolvedType()`
  Get the type of the attribute after substituting any environment variables
  `String`
  `getResolvedValue()`
  Get the value of the attribute after substituting any environment variables
  `String`
  `getType()`
  Get the type of the new attribute
  `String`
  `getValue()`
  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`
  `setName(String name)`
  Set the name of the new attribute
  `void`
  `setType(String type)`
  Set the type of the new attribute
  `void`
  `setValue(String value)`
  Set the value of the new attribute.
  `String`
  `toString()`
  Return a nicely formatted string for display
  `String`
  `toStringInternal()`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### AttributeSpec

    public AttributeSpec()
    Default constructor

  - ### AttributeSpec

    public AttributeSpec(String spec)
    Constructor that takes an attribute specification in internal format
    Parameters:
      `spec` - the attribute spec to use

- ## Method Details

  - ### setName

    public void setName(String name)
    Set the name of the new attribute
    Parameters:
      `name` - the name of the new attribute

  - ### getName

    public String getName()
    Get the name of the new attribute
    Returns:
      the name of the new attribute

  - ### setType

    public void setType(String type)
    Set the type of the new attribute
    Parameters:
      `type` - the type of the new attribute

  - ### getType

    public String getType()
    Get the type of the new attribute
    Returns:
      the type of the new attribute

  - ### setValue

    public void setValue(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 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 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 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 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 String getDateFormat()
    Get the date formatting string (if any)
    Returns:
      the date formatting string

  - ### getDateValue

    public 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 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 String toString()
    Return a nicely formatted string for display
    Overrides:
      `toString` in class `Object`
    Returns:
      a textual description

  - ### toStringInternal

    public String toStringInternal()