com.puppycrawl.tools.checkstyle.filters

Class CSVFilter

class CSVFilter extends Object implements IntFilter

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

Author: Rick Giles o_sukhodolsky

Constructor Summary
CSVFilter(String aPattern)
Constructs a CSVFilter from a CSV, Comma-Separated Values, string.
Method Summary
booleanaccept(Integer aInt)
Determines whether an Integer matches a CSV integer value.
voidaddFilter(IntFilter aFilter)
Adds a IntFilter to the set.
booleanequals(Object aObject)
{@inheritDoc}
protected SetgetFilters()
Returns the IntFilters of the filter set.
inthashCode()
{@inheritDoc}
StringtoString()
{@inheritDoc}

Constructor Detail

CSVFilter

public CSVFilter(String aPattern)
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: aPattern the CSV string.

Throws: NumberFormatException if a component substring does not contain a parsable integer.

Method Detail

accept

public boolean accept(Integer aInt)
Determines whether an Integer matches a CSV integer value.

Parameters: aInt the Integer to check.

Returns: true if aInt is an Integer that matches a CSV value.

addFilter

public void addFilter(IntFilter aFilter)
Adds a IntFilter to the set.

Parameters: aFilter the IntFilter to add.

equals

public boolean equals(Object aObject)
{@inheritDoc}

getFilters

protected Set getFilters()
Returns the IntFilters of the filter set.

Returns: the IntFilters of the filter set.

hashCode

public int hashCode()
{@inheritDoc}

toString

public String toString()
{@inheritDoc}