com.puppycrawl.tools.checkstyle.filters
Class SuppressWithNearbyCommentFilter.Tag

java.lang.Object
  extended by com.puppycrawl.tools.checkstyle.filters.SuppressWithNearbyCommentFilter.Tag
All Implemented Interfaces:
java.lang.Comparable<SuppressWithNearbyCommentFilter.Tag>
Enclosing class:
SuppressWithNearbyCommentFilter

public class SuppressWithNearbyCommentFilter.Tag
extends java.lang.Object
implements java.lang.Comparable<SuppressWithNearbyCommentFilter.Tag>

A Tag holds a suppression comment and its location.


Constructor Summary
SuppressWithNearbyCommentFilter.Tag(java.lang.String aText, int aLine)
          Constructs a tag.
 
Method Summary
 int compareTo(SuppressWithNearbyCommentFilter.Tag aOther)
          Compares the position of this tag in the file with the position of another tag.
 int getFirstLine()
           
 int getLastLine()
           
 java.lang.String getText()
           
 boolean isMatch(AuditEvent aEvent)
          Determines whether the source of an audit event matches the text of this tag.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SuppressWithNearbyCommentFilter.Tag

public SuppressWithNearbyCommentFilter.Tag(java.lang.String aText,
                                           int aLine)
                                    throws org.apache.commons.beanutils.ConversionException
Constructs a tag.

Parameters:
aText - the text of the suppression.
aLine - the line number.
Throws:
org.apache.commons.beanutils.ConversionException - if unable to parse expanded aText. on.
Method Detail

getText

public java.lang.String getText()
Returns:
the text of the tag.

getFirstLine

public int getFirstLine()
Returns:
the line number of the first suppressed line.

getLastLine

public int getLastLine()
Returns:
the line number of the last suppressed line.

compareTo

public int compareTo(SuppressWithNearbyCommentFilter.Tag aOther)
Compares the position of this tag in the file with the position of another tag.

Specified by:
compareTo in interface java.lang.Comparable<SuppressWithNearbyCommentFilter.Tag>
Parameters:
aOther - the tag to compare with this one.
Returns:
a negative number if this tag is before the other tag, 0 if they are at the same position, and a positive number if this tag is after the other tag.
See Also:
Comparable.compareTo(java.lang.Object)

isMatch

public boolean isMatch(AuditEvent aEvent)
Determines whether the source of an audit event matches the text of this tag.

Parameters:
aEvent - the AuditEvent to check.
Returns:
true if the source of aEvent matches the text of this tag.

toString

public final java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2001-2010. All Rights Reserved.