Package adams.db

Class AbstractConditions

    • Constructor Detail

      • AbstractConditions

        public AbstractConditions()
    • Method Detail

      • update

        public abstract void update()
        Automatically corrects values, but does not throw any exceptions. Derived classes must override this method.
      • check

        public void check()
        Checks the correctness of the provided values, may throw unchecked Exceptions.

        Default implementation merely calls "update()" to ensure corrected values. Derived classes can add checks/throw exceptions.
      • compareTo

        public int compareTo​(Object o)
        Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

        Only compares the commandlines of the two objects.
        Parameters:
        o - the object to be compared.
        Returns:
        a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
        Throws:
        ClassCastException - if the specified object's type prevents it from being compared to this object.
      • equals

        public boolean equals​(Object o)
        Returns whether the two objects are the same.

        Only compares the commandlines of the two objects.
        Overrides:
        equals in class Object
        Parameters:
        o - the object to be compared
        Returns:
        true if the object is the same as this one
      • shallowCopy

        public AbstractConditions shallowCopy()
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Returns:
        the shallow copy
      • shallowCopy

        public AbstractConditions shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Parameters:
        expand - whether to expand variables to their current values
        Returns:
        the shallow copy
      • getFilters

        public static String[] getFilters()
        Returns a list with classnames of conditions.
        Returns:
        the conditions classnames
      • forName

        public static AbstractConditions forName​(String classname,
                                                 String[] options)
        Instantiates the conditions with the given options.
        Parameters:
        classname - the classname of the conditions to instantiate
        options - the options for the conditions
        Returns:
        the instantiated conditions or null if an error occurred
      • forCommandLine

        public static AbstractConditions forCommandLine​(String cmdline)
        Instantiates the conditions from the given commandline (i.e., classname and optional options).
        Parameters:
        cmdline - the classname (and optional options) of the conditions to instantiate
        Returns:
        the instantiated conditions or null if an error occurred