Interface Expr

All Superinterfaces:
SimpleTyped, Typed
All Known Subinterfaces:
Assignable, Const, FieldVar, InstanceFieldVar, LocalVar, ParamVar, StaticFieldVar, This, Var

public sealed interface Expr extends SimpleTyped permits Const, Assignable, This (not exhaustive)
An expression.
  • Method Details

    • type

      ClassDesc type()
      Returns the expression type (not null).
      Specified by:
      type in interface SimpleTyped
      Specified by:
      type in interface Typed
      Returns:
      the expression type (not null)
    • genericType

      GenericType genericType()
      Returns the generic expression type (not null). If hasGenericType() returns false, the returned type will be a wrapper around type().
      Returns:
      the generic expression type (not null)
    • hasGenericType

      boolean hasGenericType()
      Returns true if this value has a generic type, or false if it does not have one.
      Returns:
      true if this value has a generic type, or false if it does not have one
    • elem

      Assignable elem(Expr index)
      Returns an assignable for an element of this array.
      Parameters:
      index - the array index (must not be null)
      Returns:
      an assignable for an element of this array
    • elem

      default Assignable elem(Integer index)
      Returns an assignable for an element of this array.
      Parameters:
      index - the array index (must not be null)
      Returns:
      an assignable for an element of this array
    • elem

      default Assignable elem(int index)
      Returns an assignable for an element of this array.
      Parameters:
      index - the array index
      Returns:
      an assignable for an element of this array
    • length

      Expr length()
      Returns the length of this array.
      Returns:
      the length of this array
    • field

      Returns an assignable for a field of this object.
      Parameters:
      desc - the field descriptor (must not be null)
      Returns:
      an assignable for a field of this object
    • field

      InstanceFieldVar field(FieldDesc desc, GenericType genericType)
      Returns an assignable for a field of this object.
      Parameters:
      desc - the field descriptor (must not be null)
      genericType - the field's expected generic type (must not be null)
      Returns:
      an assignable for a field of this object
    • field

      default InstanceFieldVar field(ClassDesc owner, String name, ClassDesc type)
      Returns an assignable for a field of this object.
      Parameters:
      owner - the descriptor of the owner of this field (must not be null)
      name - the name of the field (must not be null)
      type - the descriptor for the type of the field (must not be null)
      Returns:
      an assignable for a field of this object
    • field

      default InstanceFieldVar field(ClassDesc owner, String name, GenericType type)
      Returns an assignable for a field of this object.
      Parameters:
      owner - the descriptor of the owner of this field (must not be null)
      name - the name of the field (must not be null)
      type - the generic type of the field (must not be null)
      Returns:
      an assignable for a field of this object
    • staticField

      static StaticFieldVar staticField(FieldDesc desc)
      Returns an assignable for a static field.
      Parameters:
      desc - the field descriptor (must not be null)
      Returns:
      an assignable for a static field
    • staticField

      static StaticFieldVar staticField(FieldDesc desc, GenericType genericType)
      Returns an assignable for a static field.
      Parameters:
      desc - the field descriptor (must not be null)
      genericType - the field's expected generic type (must not be null)
      Returns:
      an assignable for a static field