Class CsvFilter

  • All Implemented Interfaces:
    IntFilter

    class CsvFilter
    extends java.lang.Object
    implements IntFilter

    This filter accepts an integer that matches a CSV value, where each value is an integer or a range of integers.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<IntFilter> filters
      Filter set.
    • Constructor Summary

      Constructors 
      Constructor Description
      CsvFilter​(java.lang.String pattern)
      Constructs a CsvFilter from a CSV, Comma-Separated Values, string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean accept​(int intValue)
      Determines whether an Integer matches a CSV integer value.
      void addFilter​(IntFilter filter)
      Adds a IntFilter to the set.
      boolean equals​(java.lang.Object object)  
      protected java.util.Set<IntFilter> getFilters()
      Returns the IntFilters of the filter set.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • filters

        private final java.util.Set<IntFilter> filters
        Filter set.
    • Constructor Detail

      • CsvFilter

        CsvFilter​(java.lang.String pattern)
        Constructs a CsvFilter from a CSV, Comma-Separated Values, string. Each value is an integer, or a range of integers. A range of integers is of the form integer-integer, such as 1-10. Note: integers must be non-negative.
        Parameters:
        pattern - the CSV string.
        Throws:
        java.lang.NumberFormatException - if a component substring does not contain a parsable integer.
    • Method Detail

      • addFilter

        public final void addFilter​(IntFilter filter)
        Adds a IntFilter to the set.
        Parameters:
        filter - the IntFilter to add.
      • getFilters

        protected java.util.Set<IntFilter> getFilters()
        Returns the IntFilters of the filter set.
        Returns:
        the IntFilters of the filter set.
      • accept

        public boolean accept​(int intValue)
        Determines whether an Integer matches a CSV integer value.
        Specified by:
        accept in interface IntFilter
        Parameters:
        intValue - the Integer to check.
        Returns:
        true if intValue is an Integer that matches a CSV value.
      • equals

        public boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object