Class BinnableInstances.StringAttributeGroupExtractor

  • All Implemented Interfaces:
    adams.data.binning.operation.Grouping.GroupExtractor<weka.core.Instance>, Serializable
    Enclosing class:
    BinnableInstances

    public static class BinnableInstances.StringAttributeGroupExtractor
    extends Object
    implements adams.data.binning.operation.Grouping.GroupExtractor<weka.core.Instance>, Serializable
    Group extractor for string attributes.
    See Also:
    Serialized Form
    • Field Detail

      • m_Index

        protected int m_Index
        the attribute index.
      • m_RegExp

        protected String m_RegExp
        the regular expression.
      • m_Group

        protected String m_Group
        the group to extract.
    • Constructor Detail

      • StringAttributeGroupExtractor

        public StringAttributeGroupExtractor​(int index,
                                             String regExp,
                                             String group)
        Initializes the extractor.
        Parameters:
        index - the index (0-based) of the string attribute
        regExp - the regular expression to apply to the strings
        group - the regexp group to extract as group
    • Method Detail

      • extractGroup

        public String extractGroup​(adams.data.binning.Binnable<weka.core.Instance> item)
        Extracts the group from the binnable object.
        Specified by:
        extractGroup in interface adams.data.binning.operation.Grouping.GroupExtractor<weka.core.Instance>
        Parameters:
        item - the item to extract the group from
        Returns:
        the extracted group