Class ConfigParameter<T>


  • public class ConfigParameter<T>
    extends uk.ac.starlink.task.Parameter<T>
    Typed parameter subclass intended to get the value for a ConfigKey.
    Since:
    1 Mar 2013
    Author:
    Mark Taylor
    • Field Summary

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

        BY_NAME
    • Constructor Summary

      Constructors 
      Constructor Description
      ConfigParameter​(ConfigKey<T> key)
      Constructs an un-suffixed config parameter.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> ConfigParameter<T> createLayerSuffixedParameter​(ConfigKey<T> key, java.lang.String layerSuffix, boolean hasSuffixDetail)
      Returns a layer-indexed config parameter with a given layer suffix.
      static <T> ConfigParameter<T> createZoneSuffixedParameter​(ConfigKey<T> key, java.lang.String zoneSuffix, boolean hasSuffixDetail)
      Returns a zone-indexed config parameter with a given zone suffix.
      java.lang.String objectToString​(uk.ac.starlink.task.Environment env, T objval)  
      void setDefaultOption​(T dflt)
      Sets the typed default value for this parameter.
      T stringToObject​(uk.ac.starlink.task.Environment env, java.lang.String stringval)  
      • Methods inherited from class uk.ac.starlink.task.Parameter

        clearValue, getDescription, getName, getPosition, getPreferExplicit, getPrompt, getStringDefault, getUsage, getValueClass, isNullPermitted, objectValue, setDescription, setDescription, setName, setNullPermitted, setPosition, setPreferExplicit, setPrompt, setStringDefault, setUsage, setValue, setValueFromObject, setValueFromString, stringValue, toArray, toString
      • Methods inherited from class java.lang.Object

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

      • ConfigParameter

        public ConfigParameter​(ConfigKey<T> key)
        Constructs an un-suffixed config parameter.
        Parameters:
        key - config key
    • Method Detail

      • stringToObject

        public T stringToObject​(uk.ac.starlink.task.Environment env,
                                java.lang.String stringval)
                         throws uk.ac.starlink.task.TaskException
        Specified by:
        stringToObject in class uk.ac.starlink.task.Parameter<T>
        Throws:
        uk.ac.starlink.task.TaskException
      • objectToString

        public java.lang.String objectToString​(uk.ac.starlink.task.Environment env,
                                               T objval)
        Overrides:
        objectToString in class uk.ac.starlink.task.Parameter<T>
      • setDefaultOption

        public void setDefaultOption​(T dflt)
        Sets the typed default value for this parameter.
        Parameters:
        dflt - typed default value
      • createLayerSuffixedParameter

        public static <T> ConfigParameter<T> createLayerSuffixedParameter​(ConfigKey<T> key,
                                                                          java.lang.String layerSuffix,
                                                                          boolean hasSuffixDetail)
        Returns a layer-indexed config parameter with a given layer suffix. The name is constructed from the key name followed by the suffix.
        Parameters:
        key - config key
        layerSuffix - suffix part of name
        hasSuffixDetail - if true, adds additional description about layer suffix usage
        Returns:
        new parameter
      • createZoneSuffixedParameter

        public static <T> ConfigParameter<T> createZoneSuffixedParameter​(ConfigKey<T> key,
                                                                         java.lang.String zoneSuffix,
                                                                         boolean hasSuffixDetail)
        Returns a zone-indexed config parameter with a given zone suffix. The name is constructed from the key name followed by the suffix.
        Parameters:
        key - config key
        zoneSuffix - suffix part of name
        hasSuffixDetail - if true, adds additional description about zone suffix usage
        Returns:
        new parameter