Class AbstractColumnFinder

    • Constructor Detail

      • AbstractColumnFinder

        public AbstractColumnFinder()
    • Method Detail

      • check

        protected void check​(weka.core.Instances data)
        Checks the data.

        Default implementation only checks whether we have any data at all.
        Parameters:
        data - the data to check
      • doFindColumns

        protected abstract int[] doFindColumns​(weka.core.Instances data)
        Returns the columns of interest in the dataset.
        Parameters:
        data - the dataset to inspect
        Returns:
        the columns of interest
      • findColumns

        public int[] findColumns​(weka.core.Instances data)
        Returns the columns of interest in the dataset.
        Specified by:
        findColumns in interface ColumnFinder
        Parameters:
        data - the dataset to inspect
        Returns:
        the columns of interest
      • 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.
      • 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 ColumnFinder shallowCopy​(boolean expand)
        Returns a shallow copy of itself, i.e., based on the commandline options.
        Specified by:
        shallowCopy in interface ShallowCopySupporter<ColumnFinder>
        Parameters:
        expand - whether to expand variables to their current values
        Returns:
        the shallow copy
      • getColumnFinders

        public static String[] getColumnFinders()
        Returns a list with classnames of column finders.
        Returns:
        the column finder classnames
      • forName

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

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

        public static HashSet<Integer> arrayToHashSet​(int[] indices)
        Turns the array into a hashset.
        Parameters:
        indices - the indices to turn into hashset
        Returns:
        the generated hashset