CodeQL library for Java/Kotlin
codeql/java-all 0.9.2-dev (changelog, source)
Search

Class PatternCase

A pattern case of a switch statement

Import path

import java

Direct supertypes

Indirect supertypes

Known direct subtypes

    Predicates

    getAPattern

    Gets any of this case’s patterns.

    getAPrimaryQlClass

    Gets the name of a primary CodeQL class to which this element belongs.

    getGuard

    Gets the guard applicable to this pattern case, if any.

    getHalsteadID

    This statement’s Halstead ID (used to compute Halstead metrics).

    getPattern

    DEPRECATED: alias for getPattern(0)

    getPattern

    Gets this case’s nth pattern.

    getUniquePattern

    Gets this case’s sole pattern, if there is exactly one.

    pp

    Gets a printable representation of this statement. May include more detail than toString().

    toString

    Gets a textual representation of this element.

    Inherited predicates

    getAChild

    Gets a child of this statement, if any.

    from Stmt
    getBasicBlock

    Gets the basic block in which this statement occurs.

    from Stmt
    getCaseIndex

    Gets this case’s ordinal in its switch block.

    from SwitchCase
    getCompilationUnit

    Gets the compilation unit in which this statement occurs.

    from Stmt
    getControlFlowNode

    Gets the ControlFlowNode corresponding to this statement.

    from Stmt
    getEnclosingCallable

    Gets the immediately enclosing callable (method or constructor) whose body contains this statement.

    from Stmt
    getEnclosingStmt

    Gets the statement containing this statement, if any.

    from Stmt
    getFile

    Gets the file associated with this element.

    from Top
    getIndex

    Gets the index of this statement as a child of its parent.

    from Stmt
    getLocation

    Gets the source location for this element.

    from Top
    getMetrics

    Cast this statement to a class that provides access to metrics information.

    from Stmt
    getNumberOfCommentLines

    Gets the number of comment lines that this element ranges over.

    from Top
    getNumberOfLinesOfCode

    Gets the number of lines of code that this element ranges over.

    from Top
    getParent

    Gets the parent of this statement.

    from Stmt
    getPrimaryQlClasses

    Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs.

    from Top
    getRuleExpression

    Gets the expression on the right-hand side of the arrow, if any.

    from SwitchCase
    getRuleStatement

    Gets the statement on the right-hand side of the arrow, if any.

    from SwitchCase
    getSelectorExpr

    Gets the expression of the surrounding switch that this case is compared against.

    from SwitchCase
    getSwitch

    Gets the switch statement to which this case belongs, if any.

    from SwitchCase
    getSwitchExpr

    Gets the switch expression to which this case belongs, if any.

    from SwitchCase
    getTotalNumberOfLines

    Gets the total number of lines that this element ranges over, including lines of code, comment and whitespace-only lines.

    from Top
    hasLocationInfo

    Holds if this element is at the specified location. The location spans column startcolumn of line startline to column endcolumn of line endline in file filepath. For more information, see Locations.

    from Top
    isNthCaseOf

    Holds if this is the nth case of switch block parent.

    from SwitchCase
    isNthChildOf

    Holds if this statement is the child of the specified parent at the specified (zero-based) position.

    from Stmt
    isRule

    Holds if this case is a switch labeled rule of the form ... -> ....

    from SwitchCase

    Charpred