Class DashParameter

java.lang.Object
uk.ac.starlink.task.Parameter<float[]>
uk.ac.starlink.ttools.plottask.NamedObjectParameter<float[]>
uk.ac.starlink.ttools.plottask.DashParameter

public class DashParameter extends NamedObjectParameter<float[]>
Parameter for selecting line dash types.
Since:
15 Aug 2008
Author:
Mark Taylor
See Also:
  • Field Summary

    Fields inherited from class uk.ac.starlink.task.Parameter

    BY_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    float[]
    dashValue(uk.ac.starlink.task.Environment env)
    Returns the value of this parameter as a dash array.
    float[]
    Translates a string value for this parameter into the object value which it represents.
    Returns an XML string, suitable for inclusion into a parameter description, which explains the format of values accepted by this parameter.
    toString(float[] dash)
    Translates a possible option value of this parameter into a string which represents it as a string value.

    Methods inherited from class uk.ac.starlink.ttools.plottask.NamedObjectParameter

    addOption, getNames, getOptionList, getOptions, getUsage, setDefaultOption, setUsage, stringToObject

    Methods inherited from class uk.ac.starlink.task.Parameter

    clearValue, getDescription, getName, getPosition, getPreferExplicit, getPrompt, getStringDefault, getValueClass, isNullPermitted, objectToString, objectValue, setDescription, setDescription, setName, setNullPermitted, setPosition, setPreferExplicit, setPrompt, setStringDefault, setValue, setValueFromObject, setValueFromString, stringValue, toArray, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • DashParameter

      public DashParameter(String name)
      Constructor.
      Parameters:
      name - parameter name
  • Method Details

    • getFormatDescription

      public String getFormatDescription()
      Returns an XML string, suitable for inclusion into a parameter description, which explains the format of values accepted by this parameter. The returned string is not encosed in a <p> element.
      Returns:
      XML format description
    • dashValue

      public float[] dashValue(uk.ac.starlink.task.Environment env) throws uk.ac.starlink.task.TaskException
      Returns the value of this parameter as a dash array.
      Returns:
      float array giving dash type
      Throws:
      uk.ac.starlink.task.TaskException
    • toString

      public String toString(float[] dash)
      Description copied from class: NamedObjectParameter
      Translates a possible option value of this parameter into a string which represents it as a string value.
      Overrides:
      toString in class NamedObjectParameter<float[]>
      Parameters:
      dash - object value
      Returns:
      corresponding string
    • fromString

      public float[] fromString(String name)
      Description copied from class: NamedObjectParameter
      Translates a string value for this parameter into the object value which it represents. Must return a suitable object value for this parameter, or throw an unchecked exception.

      The implementation must be such that fromString(toString(o)).equals(o).

      Specified by:
      fromString in class NamedObjectParameter<float[]>
      Parameters:
      name - option name
      Returns:
      corresponding option value