public class PropertyAsAttributeGenerator extends BaseAttributeGenerator
Entries in dataset must contain a measurement for this property, otherwise
they are assigned Double.NaN as the attribute value. If the dataset
does not contain the property as any of the options, addAttributes(magpie.data.Dataset)
will throw an exception.
Usage: <properties...>
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<java.lang.String> |
Properties
List of properties to use as attributes.
|
| Constructor and Description |
|---|
PropertyAsAttributeGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttributes(Dataset data)
Generate new attributes for a dataset.
|
void |
addProperty(java.lang.String prop)
Add property to list of properties used as attributes.
|
void |
clearProperties()
Clear the list of properties being used as attributes.
|
java.lang.String |
printDescription(boolean htmlFormat)
Print out description of attributes.
|
java.lang.String |
printUsage()
Print out required format for options.
|
void |
setOptions(java.util.List<java.lang.Object> Options)
Set any options for this object.
|
runCommandprotected java.util.Set<java.lang.String> Properties
public void setOptions(java.util.List<java.lang.Object> Options)
throws java.lang.Exception
OptionsOptions - Array of options as Objects - can be nulljava.lang.Exception - if problem with inputspublic java.lang.String printUsage()
Optionspublic void clearProperties()
public void addProperty(java.lang.String prop)
prop - Property to use as attributespublic void addAttributes(Dataset data) throws java.lang.Exception
BaseAttributeGeneratoraddAttributes in class BaseAttributeGeneratordata - Dataset to be added tojava.lang.ExceptionDataset.addAttribute(java.lang.String, double[])public java.lang.String printDescription(boolean htmlFormat)
BaseAttributeGeneratorImplementation Notes
Format should look like
[Full Name of generator]: (Number of attributes) Text description of what these attributes are
For HTML format, omit the ":".
printDescription in class BaseAttributeGeneratorhtmlFormat - Whether to print in HTML format