Class Defaults


  • public class Defaults
    extends java.lang.Object
    Stores a collection of default values, associated with their respective parameters by the parameters' unique IDs.
    Author:
    Marty Lamb
    • Constructor Summary

      Constructors 
      Constructor Description
      Defaults()
      Creates a new, empty Defaults object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDefault​(java.lang.String paramID, java.lang.String defaultValue)
      Adds a single default value to any that might already be defined for the parameter with the the specified ID.
      void addDefault​(java.lang.String paramID, java.lang.String[] defaultValue)
      Adds an array of default values to any that might already be defined for the parameter with the the specified ID.
      java.lang.String[] getDefault​(java.lang.String paramID)
      Returns an array of the default values defined for the parameter with the specified ID, or null if no default values are defined.
      java.util.Iterator idIterator()
      Returns an Iterator over the unique IDs of all parameters with defaults defined in this Defaults object.
      void setDefault​(java.lang.String paramID, java.lang.String defaultValue)
      Sets a single default value for the parameter with the specified ID.
      void setDefault​(java.lang.String paramID, java.lang.String[] defaultValue)
      Sets an array of default values for the parameter with the specified ID.
      protected void setDefaultIfNeeded​(java.lang.String paramID, java.lang.String defaultValue)
      Sets a single default value for the parameter with the specified ID if and only if the specified parameter currently has no default values.
      protected void setDefaultIfNeeded​(java.lang.String paramID, java.lang.String[] defaultValue)
      Sets an array of default values for the parameter with the specified ID if and only if the specified parameter currently has no default values.
      • Methods inherited from class java.lang.Object

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

      • Defaults

        public Defaults()
        Creates a new, empty Defaults object.
    • Method Detail

      • setDefault

        public void setDefault​(java.lang.String paramID,
                               java.lang.String defaultValue)
        Sets a single default value for the parameter with the specified ID. This replaces any default values currently associated with the specified parameter if any exist.
        Parameters:
        paramID - the unique ID of the parameter for which the specified value is the default.
        defaultValue - the new default value for the specified parameter.
      • setDefault

        public void setDefault​(java.lang.String paramID,
                               java.lang.String[] defaultValue)
        Sets an array of default values for the parameter with the specified ID. These replace any default values currently associated with the specified parameter if any exist.
        Parameters:
        paramID - the unique ID of the parameter for which the specified values are the defaults.
        defaultValue - the new default values for the specified parameter.
      • addDefault

        public void addDefault​(java.lang.String paramID,
                               java.lang.String defaultValue)
        Adds a single default value to any that might already be defined for the parameter with the the specified ID.
        Parameters:
        paramID - the unique ID of the parameter for which the specified value is an additional default.
        defaultValue - the default value to add to the specified parameter.
      • addDefault

        public void addDefault​(java.lang.String paramID,
                               java.lang.String[] defaultValue)
        Adds an array of default values to any that might already be defined for the parameter with the the specified ID.
        Parameters:
        paramID - the unique ID of the parameter for which the specified value is an additional default.
        defaultValue - the default values to add to the specified parameter.
      • setDefaultIfNeeded

        protected void setDefaultIfNeeded​(java.lang.String paramID,
                                          java.lang.String defaultValue)
        Sets a single default value for the parameter with the specified ID if and only if the specified parameter currently has no default values.
        Parameters:
        paramID - the unique ID of the parameter for which the specified value is the default.
        defaultValue - the new default value for the specified parameter.
      • setDefaultIfNeeded

        protected void setDefaultIfNeeded​(java.lang.String paramID,
                                          java.lang.String[] defaultValue)
        Sets an array of default values for the parameter with the specified ID if and only if the specified parameter currently has no default values.
        Parameters:
        paramID - the unique ID of the parameter for which the specified value is the default.
        defaultValue - the new default values for the specified parameter.
      • getDefault

        public java.lang.String[] getDefault​(java.lang.String paramID)
        Returns an array of the default values defined for the parameter with the specified ID, or null if no default values are defined.
        Parameters:
        paramID - the unique ID of the parameter for which default values are desired.
        Returns:
        an array of the default values defined for the parameter with the specified ID, or null if no default values are defined.
      • idIterator

        public java.util.Iterator idIterator()
        Returns an Iterator over the unique IDs of all parameters with defaults defined in this Defaults object.
        Returns:
        an Iterator over the unique IDs of all parameters with defaults defined in this Defaults object.
        See Also:
        Iterator