Class JNewArrayExpr

java.lang.Object
sootup.core.jimple.common.expr.JNewArrayExpr
All Implemented Interfaces:
EquivTo, Expr, Value, JimpleIR, Acceptor<ExprVisitor>

public final class JNewArrayExpr extends Object implements Expr
An expression that creates a new array of a certain type and a certain size.
  • Constructor Details

  • Method Details

    • equivTo

      public boolean equivTo(Object o, @NonNull JimpleComparator comparator)
      Description copied from interface: EquivTo
      Returns true if this object is equivalent to o according to the given comparator.
      Specified by:
      equivTo in interface EquivTo
      Parameters:
      o - the object to compare with
      comparator - the comparator defining the equivalence relation
      Returns:
      true if this object is structurally equivalent to o under the given comparator
    • equivHashCode

      public int equivHashCode()
      Returns a hash code for this object, consistent with structural equality.
      Specified by:
      equivHashCode in interface EquivTo
      Returns:
      a structural hash code consistent with equivTo
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public void toString(@NonNull StmtPrinter up)
      Converts a parameter of type StmtPrinter to a string literal.
      Specified by:
      toString in interface Value
    • getBaseType

      public @NonNull Type getBaseType()
    • getSize

      public @NonNull Immediate getSize()
    • collectUses

      public void collectUses(List<Value> collector)
      Description copied from interface: Value
      Collects all values used by this value into the given list.
      Specified by:
      collectUses in interface Value
    • getType

      public @NonNull Type getType()
      Returns an instance of ArrayType().
      Specified by:
      getType in interface Value
      Returns:
      the type of this value
    • accept

      public <V extends ExprVisitor> V accept(@NonNull V v)
      Description copied from interface: Acceptor
      Called when this object is visited.
      Specified by:
      accept in interface Acceptor<ExprVisitor>
      Type Parameters:
      V - the concrete visitor type
      Parameters:
      v - the visitor processing this object
      Returns:
      the visitor after processing
    • withBaseType

      public @NonNull JNewArrayExpr withBaseType(@NonNull Type baseType)
    • withSize

      public @NonNull JNewArrayExpr withSize(@NonNull Immediate size)
    • isArrayOfPrimitives

      public boolean isArrayOfPrimitives()
    • isJNewArrayExpr

      public boolean isJNewArrayExpr()
      Specified by:
      isJNewArrayExpr in interface Expr
    • asJNewArrayExpr

      public JNewArrayExpr asJNewArrayExpr()
      Specified by:
      asJNewArrayExpr in interface Expr
    • toJNewArrayExpr

      public Optional<JNewArrayExpr> toJNewArrayExpr()
      Specified by:
      toJNewArrayExpr in interface Expr