Documentation of 'ec.util.ParameterDatabase' Java class
ParameterDatabase
ec.util

Class ParameterDatabase

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>


    public class ParameterDatabase
    extends java.util.Properties
    implements java.io.Serializable

    This extension of the Properties class allows you to set, get, and delete Parameters in a hierarchical tree-like database. The database consists of a list of Parameters, plus an array of "parent databases" which it falls back on when it can't find the Parameter you're looking for. Parents may also have arrays of parents, and so on..

    The parameters are loaded from a Java property-list file, which is basically a collection of parameter=value pairs, one per line. Empty lines and lines beginning with # are ignored. These parameters and their values are case-sensitive , and whitespace is trimmed I believe.

    An optional set of parameters, "parent. n ", where n are consecutive integers starting at 0, define the filenames of the database's parents.

    An optional set of parameters, "print-params", specifies whether or not parameters should be printed as they are used (through one of the get(...) methods). If print-params is unset, or set to false or FALSE, nothing is printed. If set to non-false, then the parameters are printed prepended with a "P:" when their values are requested, "E:" when their existence is tested. Prior to the "P:" or "E:" you may see a "!" (meaning that the parameter isn't in the database), or a "<" (meaning that the parameter was a default parameter which was never looked up because the primary parameter contained the value).

    When you create a ParameterDatabase using new ParameterDatabase(), it is created thus:

    DATABASE:  database
    FROM:  (empty)

    When you create a ParameterDatabase using new ParameterDatabase( file ), it is created by loading the database file, and its parent file tree, thus:

    DATABASE:  database  ->  parent0  +->  parent0  +->  parent0  +->  ....
    FROM:  (empty)    (file)  |  (parent.0)  |  (parent.0)    ....
             |    +->  parent1  +->  ....
             |    |  (parent.1)    
             |    ....      
             |          
             +->  parent1  +->  ....    
             |  (parent.1)        
             ....          

    When you create a ParameterDatabase using new ParameterDatabase( file,argv ), the preferred way, it is created thus:

    DATABASE:  database  ->  parent0  +->  parent0  +->  parent0  +->  parent0  +->  ....
    FROM:  (empty)   (argv)    (file)  |  (parent.0)  |  (parent.0)    ....
                 |    +->  parent1  +->  ....
                 |    |  (parent.1)    
                 |    ....      
                 |          
                 +->  parent1  +->  ....    
                 |  (parent.1)        
                 ....          

    ...that is, the actual top database is empty, and stores parameters added programmatically; its parent is a database formed from arguments passed in on the command line; its parent is the parameter database which actually loads from foo. This allows you to programmatically add parameters which override those in foo, then delete them, thus bringing foo's parameters back in view.

    Once a parameter database is loaded, you query it with the get methods. The database, then its parents, are searched until a match is found for your parameter. The search rules are thus: (1) the root database is searched first. (2) If a database being searched doesn't contain the data, it searches its parents recursively, starting with parent 0, then moving up, until all searches are exhausted or something was found. (3) No database is searched twice.

    The various get methods all take two parameters. The first parameter is fetched and retrieved first. If that fails, the second one (known as the default parameter) is fetched and retrieved. You can pass in null for the default parameter if you don't have one.

    You can test a parameter for existence with the exists methods.

    You can set a parameter (in the topmost database only with the set command. The remove command removes a parameter from the topmost database only. The removeDeeply command removes that parameter from every database.

    The values stored in a parameter database must not contain "#", "=", non-ascii values, or whitespace.

    Note for JDK 1.1 . Finally recovering from stupendous idiocy, JDK 1.2 included parseDouble() and parseFloat() commands; now you can READ A FLOAT FROM A STRING without having to create a Float object first! Anyway, you will need to modify the getFloat() method below if you're running on JDK 1.1, but understand that large numbers of calls to the method may be inefficient. Sample JDK 1.1 code is given with those methods, but is commented out.

    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ParameterDatabase()
      Creates an empty parameter database.
      ParameterDatabase(java.util.Dictionary map)
      Creates a new parameter database from the given Dictionary.
      ParameterDatabase(java.io.File file)
      Creates a new parameter database tree from a given database file and its parent files.
      ParameterDatabase(java.io.File file, java.lang.String[] args)
      Creates a new parameter database from a given database file and argv list.
      ParameterDatabase(java.io.InputStream stream)
      Creates a new parameter database loaded from the given stream.
      ParameterDatabase(java.lang.String pathNameRelativeToClassFile, java.lang.Class cls)
      Creates a new parameter database loaded from a parameter file located relative to a class file, wherever the class file may be (such as in a jar).
      ParameterDatabase(java.lang.String pathNameRelativeToClassFile, java.lang.Class cls, java.lang.String[] args)
      Creates a new parameter database from a given database file and argv list.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method and Description
      void addParent(ParameterDatabase database) 
      javax.swing.tree.TreeModel buildTreeModel()
      Builds a TreeModel from the available property keys.
      boolean exists(Parameter parameter)
      Deprecated. 
      use exists(Parameter, null)
      boolean exists(Parameter parameter, Parameter defaultParameter)
      Returns true if either parameter or defaultParameter exists in the database
      boolean getBoolean(Parameter parameter, Parameter defaultParameter, boolean defaultValue)
      Searches down through databases to find a given parameter; If the parameter does not exist, defaultValue is returned.
      java.lang.Class getClassForParameter(Parameter parameter, Parameter defaultParameter, java.lang.Class mustCastTosuperclass)
      Searches down through databases to find a given parameter.
      double getDouble(Parameter parameter, Parameter defaultParameter) 
      double getDouble(Parameter parameter, Parameter defaultParameter, double minValue)
      Searches down through databases to find a given parameter, whose value must be a double >= minValue.
      double getDouble(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
      Deprecated. 
      use getDoubleWithMax instead
      double getDoubleWithDefault(Parameter parameter, Parameter defaultParameter, double defaultValue)
      Searches down through databases to find a given parameter, which must be a float.
      double getDoubleWithMax(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
      Searches down through databases to find a given parameter, whose value must be a double >= minValue and <= maxValue.
      java.io.File getFile(Parameter parameter, Parameter defaultParameter)
      Searches down through the databases to find a given parameter, whose value must be an absolute or relative path name.
      float getFloat(Parameter parameter, Parameter defaultParameter) 
      float getFloat(Parameter parameter, Parameter defaultParameter, double minValue)
      Searches down through databases to find a given parameter, whose value must be a float >= minValue.
      float getFloat(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
      Deprecated. 
      Use getFloatWithMax instead
      float getFloatWithDefault(Parameter parameter, Parameter defaultParameter, double defaultValue)
      Searches down through databases to find a given parameter, which must be a float.
      float getFloatWithMax(Parameter parameter, Parameter defaultParameter, double minValue, double maxValue)
      Searches down through databases to find a given parameter, whose value must be a float >= minValue and <= maxValue.
      java.lang.Object getInstanceForParameter(Parameter parameter, Parameter defaultParameter, java.lang.Class mustCastTosuperclass)
      Searches down through databases to find a given parameter, whose value must be a full Class name, and the class must be a descendent of but not equal to mustCastTosuperclass .
      java.lang.Object getInstanceForParameterEq(Parameter parameter, Parameter defaultParameter, java.lang.Class mustCastTosuperclass)
      Searches down through databases to find a given parameter, whose value must be a full Class name, and the class must be a descendent, or equal to, mustCastTosuperclass .
      int getInt(Parameter parameter, Parameter defaultParameter)
      Searches down through databases to find a given parameter, whose value must be an integer.
      int getInt(Parameter parameter, Parameter defaultParameter, int minValue)
      Searches down through databases to find a given parameter, whose value must be an integer >= minValue.
      int getIntWithDefault(Parameter parameter, Parameter defaultParameter, int defaultValue)
      Searches down through databases to find a given parameter, which must be an integer.
      int getIntWithMax(Parameter parameter, Parameter defaultParameter, int minValue, int maxValue)
      Searches down through databases to find a given parameter, whose value must be an integer >= minValue and <= maxValue.
      java.lang.String getLabel()
      Returns a String describing the location of the ParameterDatabase holding this parameter, or "" if there is none.
      ParameterDatabase getLocation(Parameter parameter) 
      ParameterDatabase getLocation(java.lang.String parameter) 
      long getLong(Parameter parameter, Parameter defaultParameter)
      Searches down through databases to find a given parameter, whose value must be a long.
      long getLong(Parameter parameter, Parameter defaultParameter, long minValue)
      Searches down through databases to find a given parameter, whose value must be a long >= minValue.
      long getLong(Parameter parameter, Parameter defaultParameter, long minValue, long maxValue)
      Deprecated.  
      long getLongWithDefault(Parameter parameter, Parameter defaultParameter, long defaultValue)
      Searches down through databases to find a given parameter, which must be a long.
      long getLongWithMax(Parameter parameter, Parameter defaultParameter, long minValue, long maxValue)
      Searches down through databases to find a given parameter, whose value must be a long >= minValue and = < maxValue.
      java.io.InputStream getResource(Parameter parameter, Parameter defaultParameter)
      Searches down through the databases to find a given parameter, whose value must be an absolute or relative path name.
      java.util.Set getShadowedValues(Parameter parameter) 
      java.lang.String getString(Parameter parameter, Parameter defaultParameter)
      Searches down through databases to find a given parameter.
      java.lang.String getStringWithDefault(Parameter parameter, Parameter defaultParameter, java.lang.String defaultValue)
      Searches down through databases to find a given parameter.
      void list(java.io.PrintWriter p)
      Prints out all the parameters in the database, but not shadowed parameters.
      void list(java.io.PrintWriter p, boolean listShadowed)
      Prints out all the parameters in the database.
      void listAccessed(java.io.PrintWriter p)
      Prints out all the parameters marked as accessed ("gotten" by some getFoo(...) method), plus their values.
      void listGotten(java.io.PrintWriter p)
      Prints out all the parameters marked as used, plus their values.
      void listNotAccessed(java.io.PrintWriter p)
      Prints out all the parameters NOT marked as used, plus their values.
      void listNotGotten(java.io.PrintWriter p)
      Prints out all the parameters NOT marked as used, plus their values.
      static void main(java.lang.String[] args)
      Test the ParameterDatabase
      void remove(Parameter parameter)
      Removes a parameter from the topmost database.
      void removeDeeply(Parameter parameter)
      Deprecated. 
      You shouldn't modify parent databases
      void set(Parameter parameter, java.lang.String value)
      Sets a parameter in the topmost database to a given value, trimmed of whitespace.
      java.lang.String toString() 
      • Methods inherited from class java.util.Properties

        getProperty, getProperty, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
      • Methods inherited from class java.util.Hashtable

        clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keys, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ParameterDatabase

        public ParameterDatabase()
        Creates an empty parameter database.
      • ParameterDatabase

        public ParameterDatabase(java.util.Dictionary map)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
        Creates a new parameter database from the given Dictionary. Both the keys and values will be run through toString() before adding to the dataase. Keys are parameters. Values are the values of the parameters. Beware that a ParameterDatabase is itself a Dictionary; but if you pass one in here you will only get the lowest-level elements. If parent.n are defined, parents will be attempted to be loaded -- that's the reason for the FileNotFoundException and IOException.
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • ParameterDatabase

        public ParameterDatabase(java.lang.String pathNameRelativeToClassFile,
                                 java.lang.Class cls,
                                 java.lang.String[] args)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
        Creates a new parameter database from a given database file and argv list. The top-level database is completely empty, pointing to a second database which contains the parameter entries stored in args, which points to a tree of databases constructed using ParameterDatabase(filename).
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • ParameterDatabase

        public ParameterDatabase(java.lang.String pathNameRelativeToClassFile,
                                 java.lang.Class cls)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
        Creates a new parameter database loaded from a parameter file located relative to a class file, wherever the class file may be (such as in a jar). This approach uses resourceLocation.getResourceAsStream() to load the parameter file. If parent.n are defined, parents will be attempted to be loaded -- that's the reason for the FileNotFoundException and IOException.
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • ParameterDatabase

        public ParameterDatabase(java.io.InputStream stream)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
        Creates a new parameter database loaded from the given stream. Non-relative parents are not permitted. If parent.n are defined, parents will be attempted to be loaded -- that's the reason for the FileNotFoundException and IOException.
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • ParameterDatabase

        public ParameterDatabase(java.io.File file)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
        Creates a new parameter database tree from a given database file and its parent files.
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
      • ParameterDatabase

        public ParameterDatabase(java.io.File file,
                                 java.lang.String[] args)
                          throws java.io.FileNotFoundException,
                                 java.io.IOException
        Creates a new parameter database from a given database file and argv list. The top-level database is completely empty, pointing to a second database which contains the parameter entries stored in args, which points to a tree of databases constructed using ParameterDatabase(file).
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
    • Method Detail

      • getInstanceForParameter

        public java.lang.Object getInstanceForParameter(Parameter parameter,
                                                        Parameter defaultParameter,
                                                        java.lang.Class mustCastTosuperclass)
                                                 throws ParamClassLoadException
        Searches down through databases to find a given parameter, whose value must be a full Class name, and the class must be a descendent of but not equal to mustCastTosuperclass . Loads the class and returns an instance (constructed with the default constructor), or throws a ParamClassLoadException if there is no such Class. If the parameter is not found, the defaultParameter is used. The parameter chosen is marked "used".
        Throws:
        ParamClassLoadException
      • getInstanceForParameterEq

        public java.lang.Object getInstanceForParameterEq(Parameter parameter,
                                                          Parameter defaultParameter,
                                                          java.lang.Class mustCastTosuperclass)
                                                   throws ParamClassLoadException
        Searches down through databases to find a given parameter, whose value must be a full Class name, and the class must be a descendent, or equal to, mustCastTosuperclass . Loads the class and returns an instance (constructed with the default constructor), or throws a ParamClassLoadException if there is no such Class. The parameter chosen is marked "used".
        Throws:
        ParamClassLoadException
      • getClassForParameter

        public java.lang.Class getClassForParameter(Parameter parameter,
                                                    Parameter defaultParameter,
                                                    java.lang.Class mustCastTosuperclass)
                                             throws ParamClassLoadException
        Searches down through databases to find a given parameter. The value associated with this parameter must be a full Class name, and the class must be a descendent of but not equal to mustCastTosuperclass . Loads and returns the associated Class, or throws a ParamClassLoadException if there is no such Class. If the parameter is not found, the defaultParameter is used. The parameter chosen is marked "used".
        Throws:
        ParamClassLoadException
      • getBoolean

        public boolean getBoolean(Parameter parameter,
                                  Parameter defaultParameter,
                                  boolean defaultValue)
        Searches down through databases to find a given parameter; If the parameter does not exist, defaultValue is returned. If the parameter exists, and it is set to "false" (case insensitive), false is returned. Else true is returned. The parameter chosen is marked "used" if it exists.
      • getInt

        public int getInt(Parameter parameter,
                          Parameter defaultParameter)
                   throws java.lang.NumberFormatException
        Searches down through databases to find a given parameter, whose value must be an integer. It returns the value, else throws a NumberFormatException exception if there is an error in parsing the parameter. The parameter chosen is marked "used" if it exists. Integers may be in decimal or (if preceded with an X or x) in hexadecimal.
        Throws:
        java.lang.NumberFormatException
      • getInt

        public int getInt(Parameter parameter,
                          Parameter defaultParameter,
                          int minValue)
        Searches down through databases to find a given parameter, whose value must be an integer >= minValue. It returns the value, or minValue-1 if the value is out of range or if there is an error in parsing the parameter. The parameter chosen is marked "used" if it exists. Integers may be in decimal or (if preceded with an X or x) in hexadecimal.
      • getIntWithDefault

        public int getIntWithDefault(Parameter parameter,
                                     Parameter defaultParameter,
                                     int defaultValue)
        Searches down through databases to find a given parameter, which must be an integer. If there is an error in parsing the parameter, then default is returned. The parameter chosen is marked "used" if it exists. Integers may be in decimal or (if preceded with an X or x) in hexadecimal.
      • getIntWithMax

        public int getIntWithMax(Parameter parameter,
                                 Parameter defaultParameter,
                                 int minValue,
                                 int maxValue)
        Searches down through databases to find a given parameter, whose value must be an integer >= minValue and <= maxValue. It returns the value, or minValue-1 if the value is out of range or if there is an error in parsing the parameter. The parameter chosen is marked "used" if it exists. Integers may be in decimal or (if preceded with an X or x) in hexadecimal.
      • getFloat

        public float getFloat(Parameter parameter,
                              Parameter defaultParameter)
                       throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException
      • getFloat

        public float getFloat(Parameter parameter,
                              Parameter defaultParameter,
                              double minValue)
        Searches down through databases to find a given parameter, whose value must be a float >= minValue. If not, this method returns minvalue-1, else it returns the parameter value. The parameter chosen is marked "used" if it exists.
      • getFloatWithDefault

        public float getFloatWithDefault(Parameter parameter,
                                         Parameter defaultParameter,
                                         double defaultValue)
        Searches down through databases to find a given parameter, which must be a float. If there is an error in parsing the parameter, then default is returned. The parameter chosen is marked "used" if it exists.
      • getFloatWithMax

        public float getFloatWithMax(Parameter parameter,
                                     Parameter defaultParameter,
                                     double minValue,
                                     double maxValue)
        Searches down through databases to find a given parameter, whose value must be a float >= minValue and <= maxValue. If not, this method returns minvalue-1, else it returns the parameter value. The parameter chosen is marked "used" if it exists.
      • getFloat

        public float getFloat(Parameter parameter,
                              Parameter defaultParameter,
                              double minValue,
                              double maxValue)
        Deprecated. Use getFloatWithMax instead
        Searches down through databases to find a given parameter, whose value must be a float >= minValue and <= maxValue. If not, this method returns minvalue-1, else it returns the parameter value. The parameter chosen is marked "used" if it exists.
      • getDouble

        public double getDouble(Parameter parameter,
                                Parameter defaultParameter)
                         throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException
      • getDouble

        public double getDouble(Parameter parameter,
                                Parameter defaultParameter,
                                double minValue)
        Searches down through databases to find a given parameter, whose value must be a double >= minValue. If not, this method returns minvalue-1, else it returns the parameter value. The parameter chosen is marked "used" if it exists.
      • getDoubleWithMax

        public double getDoubleWithMax(Parameter parameter,
                                       Parameter defaultParameter,
                                       double minValue,
                                       double maxValue)
        Searches down through databases to find a given parameter, whose value must be a double >= minValue and <= maxValue. If not, this method returns minvalue-1, else it returns the parameter value. The parameter chosen is marked "used" if it exists.
      • getDouble

        public double getDouble(Parameter parameter,
                                Parameter defaultParameter,
                                double minValue,
                                double maxValue)
        Deprecated. use getDoubleWithMax instead
        Searches down through databases to find a given parameter, whose value must be a double >= minValue and <= maxValue. If not, this method returns minvalue-1, else it returns the parameter value. The parameter chosen is marked "used" if it exists.
      • getDoubleWithDefault

        public double getDoubleWithDefault(Parameter parameter,
                                           Parameter defaultParameter,
                                           double defaultValue)
        Searches down through databases to find a given parameter, which must be a float. If there is an error in parsing the parameter, then default is returned. The parameter chosen is marked "used" if it exists.
      • getLong

        public long getLong(Parameter parameter,
                            Parameter defaultParameter)
                     throws java.lang.NumberFormatException
        Searches down through databases to find a given parameter, whose value must be a long. It returns the value, else throws a NumberFormatException exception if there is an error in parsing the parameter. The parameter chosen is marked "used" if it exists. Longs may be in decimal or (if preceded with an X or x) in hexadecimal.
        Throws:
        java.lang.NumberFormatException
      • getLong

        public long getLong(Parameter parameter,
                            Parameter defaultParameter,
                            long minValue)
        Searches down through databases to find a given parameter, whose value must be a long >= minValue. If not, this method returns errValue, else it returns the parameter value. The parameter chosen is marked "used" if it exists. Longs may be in decimal or (if preceded with an X or x) in hexadecimal.
      • getLongWithDefault

        public long getLongWithDefault(Parameter parameter,
                                       Parameter defaultParameter,
                                       long defaultValue)
        Searches down through databases to find a given parameter, which must be a long. If there is an error in parsing the parameter, then default is returned. The parameter chosen is marked "used" if it exists. Longs may be in decimal or (if preceded with an X or x) in hexadecimal.
      • getLongWithMax

        public long getLongWithMax(Parameter parameter,
                                   Parameter defaultParameter,
                                   long minValue,
                                   long maxValue)
        Searches down through databases to find a given parameter, whose value must be a long >= minValue and = < maxValue. If not, this method returns errValue, else it returns the parameter value. The parameter chosen is marked "used" if it exists. Longs may be in decimal or (if preceded with an X or x) in hexadecimal.
      • getLong

        public long getLong(Parameter parameter,
                            Parameter defaultParameter,
                            long minValue,
                            long maxValue)
        Deprecated. 
        Use getLongWithMax(...) instead. Searches down through databases to find a given parameter, whose value must be a long >= minValue and = < maxValue. If not, this method returns errValue, else it returns the parameter value. The parameter chosen is marked "used" if it exists. Longs may be in decimal or (if preceded with an X or x) in hexadecimal.
      • getFile

        public java.io.File getFile(Parameter parameter,
                                    Parameter defaultParameter)
        Searches down through the databases to find a given parameter, whose value must be an absolute or relative path name. If it is absolute, a File is made based on the path name. If it is relative, a file is made by resolving the path name with respect to the directory in which the file was which defined this ParameterDatabase in the ParameterDatabase hierarchy. If the parameter is not found, this returns null. The File is not checked for validity. The parameter chosen is marked "used" if it exists.
      • getResource

        public java.io.InputStream getResource(Parameter parameter,
                                               Parameter defaultParameter)
        Searches down through the databases to find a given parameter, whose value must be an absolute or relative path name. If it is absolute, a file is made based on the path name, and an InputStream is opened on the file and returned. If the path name begins with "$", then an InputStream is opened on a file relative to the directory where the system was started. Otherwise if the path name is relative, an InputStream is made by resolving the path name with respect to the directory in which the file was which defined this ParameterDatabase in the ParameterDatabase hierarchy, be it in the file system or in a jar file. If the parameter is not found, this returns null. If no such file exists, null is also returned. The parameter chosen is marked "used" if it exists.
      • getString

        public java.lang.String getString(Parameter parameter,
                                          Parameter defaultParameter)
        Searches down through databases to find a given parameter. Returns the parameter's value (trimmed) or null if not found or if the trimmed result is empty. The parameter chosen is marked "used" if it exists.
      • getStringWithDefault

        public java.lang.String getStringWithDefault(Parameter parameter,
                                                     Parameter defaultParameter,
                                                     java.lang.String defaultValue)
        Searches down through databases to find a given parameter. Returns the parameter's value trimmed of whitespace, or defaultValue.trim() if the result is not found or the trimmed result is empty.
      • set

        public void set(Parameter parameter,
                        java.lang.String value)
        Sets a parameter in the topmost database to a given value, trimmed of whitespace.
      • listGotten

        public void listGotten(java.io.PrintWriter p)
        Prints out all the parameters marked as used, plus their values. If a parameter was listed as "used" but not's actually in the database, the value printed is UNKNOWN_VALUE (set to "?????")
      • listNotGotten

        public void listNotGotten(java.io.PrintWriter p)
        Prints out all the parameters NOT marked as used, plus their values.
      • listNotAccessed

        public void listNotAccessed(java.io.PrintWriter p)
        Prints out all the parameters NOT marked as used, plus their values.
      • listAccessed

        public void listAccessed(java.io.PrintWriter p)
        Prints out all the parameters marked as accessed ("gotten" by some getFoo(...) method), plus their values. If this method ever prints UNKNOWN_VALUE ("?????"), that's a bug.
      • exists

        public boolean exists(Parameter parameter)
        Deprecated. use exists(Parameter, null)
        Returns true if parameter exist in the database
      • exists

        public boolean exists(Parameter parameter,
                              Parameter defaultParameter)
        Returns true if either parameter or defaultParameter exists in the database
      • getShadowedValues

        public java.util.Set getShadowedValues(Parameter parameter)
      • getLabel

        public java.lang.String getLabel()
        Returns a String describing the location of the ParameterDatabase holding this parameter, or "" if there is none.
      • remove

        public void remove(Parameter parameter)
        Removes a parameter from the topmost database.
      • removeDeeply

        public void removeDeeply(Parameter parameter)
        Deprecated. You shouldn't modify parent databases
        Removes a parameter from the database and all its parent databases.
      • list

        public void list(java.io.PrintWriter p)
        Prints out all the parameters in the database, but not shadowed parameters.
        Overrides:
        list in class java.util.Properties
      • list

        public void list(java.io.PrintWriter p,
                         boolean listShadowed)
        Prints out all the parameters in the database. Useful for debugging. If listShadowed is true, each parameter is printed with the parameter database it's located in. If listShadowed is false, only active parameters are listed, and they're all given in one big chunk.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.Hashtable<java.lang.Object,java.lang.Object>
      • buildTreeModel

        public javax.swing.tree.TreeModel buildTreeModel()
        Builds a TreeModel from the available property keys.
      • main

        public static void main(java.lang.String[] args)
                         throws java.io.FileNotFoundException,
                                java.io.IOException
        Test the ParameterDatabase
        Throws:
        java.io.FileNotFoundException
        java.io.IOException

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.