Class ASTPath.ASTEntry
java.lang.Object
org.checkerframework.afu.scenelib.io.ASTPath.ASTEntry
- All Implemented Interfaces:
Comparable<ASTPath.ASTEntry>
- Enclosing class:
ASTPath
A single entry in an AST path.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines if the given string is equal to this AST path entry's child selector.int
boolean
int
Gets the argument of this AST entry.Gets the child selector of this AST entry.Gets the tree node equivalent kind of this AST entry.boolean
Checks that this Entry has an argument.int
hashCode()
toString()
-
Constructor Details
-
ASTEntry
Constructs a new AST entry. For example, in the entry:
the tree kind is "Block", the child selector is "statement", and the argument is "3".Block.statement 3
- Parameters:
treeKind
- the kind of this AST entrychildSelector
- the child selector to this AST entryargument
- the argument
-
ASTEntry
Constructs a new AST entry, without a numeric argument.- Parameters:
treeKind
- the kind of this AST entrychildSelector
- the child selector to this AST entry
-
-
Method Details
-
getTreeKind
Gets the tree node equivalent kind of this AST entry. For example, in
"Block" is the tree kind.Block.statement 3
- Returns:
- the tree kind
-
getChildSelector
Gets the child selector of this AST entry. For example, in
"statement" is the child selector.Block.statement 3
- Returns:
- the child selector
-
childSelectorIs
Determines if the given string is equal to this AST path entry's child selector.- Parameters:
s
- the string to compare to- Returns:
true
if the string matches the child selector,false
otherwise
-
getArgument
public int getArgument()Gets the argument of this AST entry. For example, in
"3" is the argument.Block.statement 3
- Returns:
- the argument
- Throws:
IllegalStateException
- if this AST entry does not have an argument
-
hasArgument
public boolean hasArgument()Checks that this Entry has an argument.- Returns:
- if this entry has an argument
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ASTPath.ASTEntry>
-
equals
-
hashCode
public int hashCode() -
toString
-