Class StringMatcher

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter, adams.core.SizeOfHandler, adams.data.outlier.OutlierDetector, Serializable, Comparable

    public class StringMatcher
    extends adams.data.outlier.AbstractOutlierDetector
    Checks whether the specified string field is available in the report and the value matches the specified regular expression.

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to
        the console (0 = off).
        default: 0
        minimum: 0
     
    -field <adams.data.report.Field> (property: field)
        The field to use (ie, the class).
        default: blah
     
    -regexp <java.lang.String> (property: regExp)
        The regular expression used for matching the strings.
        default: .*
     
    -invert (property: invert)
        If set to true, then the matching sense is inverted.
     
    Version:
    $Revision: 2242 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.data.outlier.AbstractOutlierDetector

        adams.data.outlier.AbstractOutlierDetector.DetectorJob<T extends adams.data.container.DataContainer>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected adams.data.report.Field m_Field
      the name of the reference compound.
      protected boolean m_Invert
      whether to invert the matching sense.
      protected adams.core.base.BaseRegExp m_RegExp
      the regular expression that the value must match.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      StringMatcher()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      String fieldTipText()
      Returns the tip text for this property.
      adams.data.report.Field getField()
      Returns the current reference (i.e., class).
      boolean getInvert()
      Returns whether to invert the matching sense.
      adams.core.base.BaseRegExp getRegExp()
      Returns the regular expression to match the strings against.
      String globalInfo()
      Returns a string describing the object.
      String invertTipText()
      Returns the tip text for this property.
      protected List<String> processData​(adams.data.container.DataContainer data)
      Performs the actual detection.
      String regExpTipText()
      Returns the tip text for this property.
      void setField​(adams.data.report.Field value)
      Sets the reference, i.e., the class.
      void setInvert​(boolean value)
      Sets whether to invert the matching sense.
      void setRegExp​(adams.core.base.BaseRegExp value)
      Sets the regular expression to match the strings against.
      • Methods inherited from class adams.data.outlier.AbstractOutlierDetector

        checkData, cleanUp, compareTo, destroy, detect, equals, forCommandLine, forName, getOutlierDetectors, getQuickInfo, reset, shallowCopy, shallowCopy
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager, toCommandLine
    • Field Detail

      • m_Field

        protected adams.data.report.Field m_Field
        the name of the reference compound.
      • m_RegExp

        protected adams.core.base.BaseRegExp m_RegExp
        the regular expression that the value must match.
      • m_Invert

        protected boolean m_Invert
        whether to invert the matching sense.
    • Constructor Detail

      • StringMatcher

        public StringMatcher()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setField

        public void setField​(adams.data.report.Field value)
        Sets the reference, i.e., the class.
        Parameters:
        value - the reference
      • getField

        public adams.data.report.Field getField()
        Returns the current reference (i.e., class).
        Returns:
        the reference
      • fieldTipText

        public String fieldTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the gui
      • setRegExp

        public void setRegExp​(adams.core.base.BaseRegExp value)
        Sets the regular expression to match the strings against.
        Parameters:
        value - the regular expression
      • getRegExp

        public adams.core.base.BaseRegExp getRegExp()
        Returns the regular expression to match the strings against.
        Returns:
        the regular expression
      • regExpTipText

        public String regExpTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setInvert

        public void setInvert​(boolean value)
        Sets whether to invert the matching sense.
        Parameters:
        value - true if inverting matching sense
      • getInvert

        public boolean getInvert()
        Returns whether to invert the matching sense.
        Returns:
        true if matching sense is inverted
      • invertTipText

        public String invertTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • processData

        protected List<String> processData​(adams.data.container.DataContainer data)
        Performs the actual detection.
        Specified by:
        processData in class adams.data.outlier.AbstractOutlierDetector
        Parameters:
        data - the data to process
        Returns:
        the detections