Class PatternExpr

All Implemented Interfaces:
NodeWithRange<Node>, NodeWithTokenRange<Node>, NodeWithType<ComponentPatternExpr, Type>, Observable, Visitable, HasParentNode<Node>, Cloneable
Direct Known Subclasses:
RecordPatternExpr, TypePatternExpr

public abstract class PatternExpr extends ComponentPatternExpr implements NodeWithType<ComponentPatternExpr, Type>
PatternExpr serves as the abstract base class for typed pattern expressions. These patterns may be used as top-level patterns in instanceof expressions and switch labels.
  • Field Details

    • type

      private Type type
      The types of record patters and top-level type patterns must be reference types, but nested type patterns can also have primitive types.
  • Constructor Details

    • PatternExpr

      public PatternExpr(Type type)
    • PatternExpr

      public PatternExpr(TokenRange tokenRange, Type type)
      This constructor is used by the parser and is considered private.
  • Method Details