Class/Object

org.opalj.br

ArrayType

Related Docs: object ArrayType | package br

Permalink

final class ArrayType extends ReferenceType

Represents an array type.

Comparing ArrayTypes

To facilitate comparisons of (array) types, each array type is represented at any given time, by exactly one instance of ArrayType.

General Information

From the JVM specification

An array type consists of a component type with a single dimension (whose length is not given by the type). The component type of an array type may itself be an array type. If, starting from any array type, one considers its component type, and then (if that is also an array type) the component type of that type, and so on, eventually one must reach a component type that is not an array type; this is called the element type of the array type. The element type of an array type is necessarily either a primitive type, or a class type, or an interface type.

Linear Supertypes
ReferenceType, FieldType, Type, Ordered[Type], Comparable[Type], UID, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ArrayType
  2. ReferenceType
  3. FieldType
  4. Type
  5. Ordered
  6. Comparable
  7. UID
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def <(other: Type): Boolean

    Permalink
    Definition Classes
    Type → Ordered
  4. def <=(other: Type): Boolean

    Permalink
    Definition Classes
    Type → Ordered
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def >(other: Type): Boolean

    Permalink
    Definition Classes
    Type → Ordered
  7. def >=(other: Type): Boolean

    Permalink
    Definition Classes
    Type → Ordered
  8. def adapt[T](targetType: Type)(implicit typeConversionFactory: TypeConversionFactory[T]): T

    Permalink

    Returns the sequence of instructions that adapts values of this type to values of the target type.

    Returns the sequence of instructions that adapts values of this type to values of the target type.

    This method supports the following kind of adaptations:

    • boxing
    • unboxing
    Definition Classes
    ArrayTypeFieldType
  9. final def asArrayType: ArrayType

    Permalink
    Definition Classes
    ArrayTypeType
  10. def asBaseType: BaseType

    Permalink
    Definition Classes
    Type
    Annotations
    @throws( "if this type is not a base type" )
  11. final def asFieldType: ArrayType.this.type

    Permalink
    Definition Classes
    FieldTypeType
  12. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  13. def asIntLikeType: IntLikeType

    Permalink
    Definition Classes
    Type
    Annotations
    @throws( "if this is not a numeric type" )
  14. def asNumericType: NumericType

    Permalink
    Definition Classes
    Type
    Annotations
    @throws( "if this is not a numeric type" )
  15. def asObjectType: ObjectType

    Permalink
    Definition Classes
    Type
    Annotations
    @throws( ... )
  16. final def asReferenceType: ReferenceType

    Permalink
    Definition Classes
    ReferenceTypeType
  17. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. def compare(that: Type): Int

    Permalink

    Compares this type with the given type.

    Compares this type with the given type.

    Comparison of types is implemented by comparing the associated ids. I.e., the result of the comparison of two types is not stable across multiple runs of OPAL.

    Definition Classes
    Type → Ordered
  19. def compareTo(that: Type): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  20. val componentType: FieldType

    Permalink
  21. final def computationalType: ComputationalTypeReference.type

    Permalink

    The computational type of values of this type.

    The computational type of values of this type.

    Definition Classes
    ReferenceTypeType
  22. def dimensions: Int

    Permalink

    The number of dimensions of this array.

    The number of dimensions of this array. E.g. "Object[]" has one dimension and "Object[][]" has two dimensions.

  23. def drop(dimensions: Int): FieldType

    Permalink

    Returns the component type of this array type after dropping the given number of dimensions.

    Returns the component type of this array type after dropping the given number of dimensions. E.g., if dimensions is 0 this is returned; if it is 1 then this arraytype's component type is returned. If the value is larger than 1 then the componentType has to be an array type and drop(dimensions-1) will be called on that type.

    dimensions

    The number of dimensions to drop. This values has be equal or smaller than the number of dimensions of this array.

  24. def elementType: FieldType

    Permalink

    Returns this array type's element type.

    Returns this array type's element type. E.g., the element type of an array of arrays of arrays of int is int.

  25. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  26. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  27. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  28. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  29. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  30. val id: Int

    Permalink

    Each reference type is associated with a unique id.

    Each reference type is associated with a unique id. Object types get ids >= 0 and array types get ids < 0.

    Definition Classes
    ArrayTypeReferenceTypeType → UID
  31. final def isArrayType: Boolean

    Permalink
    Definition Classes
    ArrayTypeType
  32. def isBaseType: Boolean

    Permalink

    Returns true if this type is a base type (also called primitive type).

    Returns true if this type is a base type (also called primitive type).

    Definition Classes
    Type
  33. def isBooleanType: Boolean

    Permalink

    Returns true if this type is the primitive type boolean.

    Returns true if this type is the primitive type boolean.

    Definition Classes
    Type
  34. def isByteType: Boolean

    Permalink

    Returns true if this type is the primitive type byte.

    Returns true if this type is the primitive type byte.

    Definition Classes
    Type
  35. def isCharType: Boolean

    Permalink

    Returns true if this type is the primitive type char (Range: [0..65535].

    Returns true if this type is the primitive type char (Range: [0..65535].

    Definition Classes
    Type
  36. def isDoubleType: Boolean

    Permalink

    Returns true if this type is the primitive type double.

    Returns true if this type is the primitive type double.

    Definition Classes
    Type
  37. final def isFieldType: Boolean

    Permalink

    Returns true if this type can be used by fields.

    Returns true if this type can be used by fields. Returns true unless this type represents void.

    Definition Classes
    FieldTypeType
  38. def isFloatType: Boolean

    Permalink

    Returns true if this type is the primitive type float.

    Returns true if this type is the primitive type float.

    Definition Classes
    Type
  39. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  40. def isIntLikeType: Boolean

    Permalink
    Definition Classes
    Type
  41. def isIntegerType: Boolean

    Permalink

    Returns true if this type is the primitive type int.

    Returns true if this type is the primitive type int.

    Definition Classes
    Type
  42. def isLongType: Boolean

    Permalink

    Returns true if this type is the primitive type long.

    Returns true if this type is the primitive type long.

    Definition Classes
    Type
  43. def isNumericType: Boolean

    Permalink
    Definition Classes
    Type
  44. def isObjectType: Boolean

    Permalink
    Definition Classes
    Type
  45. final def isReferenceType: Boolean

    Permalink

    Returns true if this type is a reference type; that is, an array type or an object type (class/interface type).

    Returns true if this type is a reference type; that is, an array type or an object type (class/interface type).

    Definition Classes
    ReferenceTypeType
    Note

    In general, we can distinguish the following three categories of types:

    • base types,
    • reference types,
    • the type void.
  46. def isShortType: Boolean

    Permalink

    Returns true if this type is the primitive type short.

    Returns true if this type is the primitive type short.

    Definition Classes
    Type
  47. def isVoidType: Boolean

    Permalink

    Returns true if this type represents void; false otherwise.

    Returns true if this type represents void; false otherwise.

    Definition Classes
    Type
  48. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  49. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  50. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  51. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  52. def toBinaryJavaName: String

    Permalink

    Returns the binary name of this type as used by the Java runtime.

    Returns the binary name of this type as used by the Java runtime. Basically returns the same name as produced by Class.getName.

    Definition Classes
    ArrayTypeType
  53. def toJVMTypeName: String

    Permalink

    Returns the representation of this type as used by the JVM in, for example, method descriptors or signatures.

    Returns the representation of this type as used by the JVM in, for example, method descriptors or signatures.

    Definition Classes
    ArrayTypeType
  54. def toJava: String

    Permalink

    A String representation of this type as it would be used in Java source code.

    A String representation of this type as it would be used in Java source code.

    Definition Classes
    ArrayTypeType
  55. def toJavaClass: Class[_]

    Permalink

    Returns the Java class object representing this type.

    Returns the Java class object representing this type.

    This is generally only useful in very special cases and – to be meaningful at all – it is necessary that the class path used for running the static analysis also contains the classes that are analyzed. This is (often) only the case for the JDK.

    However, one example where this is useful is the creation of a real object of a specific type and to use that object when a method is called on that object. This avoids the reimplementation of the respective logic as part of the analysis. For example, if you want to get the String that is created by a specific StringBuffer it is possible to implement the API of StringBuffer as part of your analysis or (probably more efficient) to just create an instance of a StringBuffer object and to redirect every call to the real object. In this case only some general logic is required to redirect calls and to convert the values between the representation used by the analysis and the representation required by the called method.

    Definition Classes
    ArrayTypeType
  56. def toString(): String

    Permalink
    Definition Classes
    ArrayType → AnyRef → Any
  57. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  58. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  59. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from ReferenceType

Inherited from FieldType

Inherited from Type

Inherited from Ordered[Type]

Inherited from Comparable[Type]

Inherited from UID

Inherited from AnyRef

Inherited from Any

Ungrouped