com.puppycrawl.tools.checkstyle.checks
Class CheckUtils

java.lang.Object
  extended bycom.puppycrawl.tools.checkstyle.checks.CheckUtils

public final class CheckUtils
extends java.lang.Object

Contains utility methods for the checks.

Author:
Oliver Burn, Simon Harris

Method Summary
static FullIdent createFullType(DetailAST aTypeAST)
          Creates FullIdent for given type node.
static boolean isElseIf(DetailAST aAST)
          Returns whether a token represents an ELSE as part of an ELSE / IF set.
static float parseFloat(java.lang.String aText, int aType)
          Returns the value represented by the specified string of the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isElseIf

public static boolean isElseIf(DetailAST aAST)
Returns whether a token represents an ELSE as part of an ELSE / IF set.

Parameters:
aAST - the token to check
Returns:
whether it is

createFullType

public static FullIdent createFullType(DetailAST aTypeAST)
Creates FullIdent for given type node.

Parameters:
aTypeAST - a type node.
Returns:
FullIdent for given type.

parseFloat

public static float parseFloat(java.lang.String aText,
                               int aType)
Returns the value represented by the specified string of the specified type. Returns 0 for types other than float, double, int, and long.

Parameters:
aText - the string to be parsed.
aType - the token type of the text. Should be a constant of TokenTypes.
Returns:
the float value represented by the string argument.

Back to the Checkstyle Home Page