public final class CheckUtils extends Object
Modifier and Type | Method and Description |
---|---|
static FullIdent |
createFullType(DetailAST typeAST)
Creates
FullIdent for given type node. |
static DetailAST |
getFirstNode(DetailAST node)
Finds sub-node for given node minimal (line, column) pair.
|
static List<String> |
getTypeParameterNames(DetailAST node)
Retrieves the names of the type parameters to the node.
|
static List<DetailAST> |
getTypeParameters(DetailAST node)
Retrieves the type parameters to the node.
|
static boolean |
isElseIf(DetailAST ast)
Returns whether a token represents an ELSE as part of an ELSE / IF set.
|
static boolean |
isEqualsMethod(DetailAST ast)
Tests whether a method definition AST defines an equals covariant.
|
static double |
parseDouble(String text,
int type)
Returns the value represented by the specified string of the specified
type.
|
static double |
parseFloat(String text,
int type)
Returns the value represented by the specified string of the specified
type.
|
static int |
parseInt(String text,
int radix)
Parses the string argument as a signed integer in the radix specified by
the second argument.
|
static long |
parseLong(String text,
int radix)
Parses the string argument as a signed long in the radix specified by
the second argument.
|
public static boolean isEqualsMethod(DetailAST ast)
ast
- the method definition AST to test.
Precondition: ast is a TokenTypes.METHOD_DEF node.public static boolean isElseIf(DetailAST ast)
ast
- the token to checkpublic static FullIdent createFullType(DetailAST typeAST)
FullIdent
for given type node.typeAST
- a type node.FullIdent
for given type.public static double parseDouble(String text, int type)
text
- the string to be parsed.type
- the token type of the text. Should be a constant of
TokenTypes
.public static int parseInt(String text, int radix)
text
- the String containing the integer representation to be
parsed. Precondition: text contains a parsable int.radix
- the radix to be used while parsing text.public static long parseLong(String text, int radix)
text
- the String containing the integer representation to be
parsed. Precondition: text contains a parsable int.radix
- the radix to be used while parsing text.public static double parseFloat(String text, int type)
text
- the string to be parsed.type
- the token type of the text. Should be a constant of
TokenTypes
.public static DetailAST getFirstNode(DetailAST node)
node
- the root of tree for search.public static List<String> getTypeParameterNames(DetailAST node)
node
- the parameterised AST nodepublic static List<DetailAST> getTypeParameters(DetailAST node)
node
- the parameterised AST nodeCopyright © 2001–2015. All rights reserved.