All Superinterfaces:
Comparable<IWildcardType>, ICodeItem, INativeItem, INativeItemListenable

@Ser public interface IWildcardType extends INativeItem, Comparable<IWildcardType>
Wildcard types can be defined (they wrap native types) or undefined (they contain a set of attributes partially defining the actual type, such as effective size, group, signedness, etc.).
  • Method Details

    • getNativeType

      INativeType getNativeType()
      If the wildcard type is defined, provide the wrapped native type.
      Returns:
    • isVoid

      boolean isVoid()
      Returns:
      true if this wildcard type wraps the native void type
    • getBitsize

      int getBitsize()
      The currently determined size of this wildcard type. If defined, it is trivial. If undefined, it is either the maximum bitsize or the effective bitsize (if non-zero).
      Returns:
      always >0
    • getMaximumBitsize

      int getMaximumBitsize()
      Maximum effective size for an undefined wildcard type.
      Returns:
      always >0
    • getEffectiveBitsize

      int getEffectiveBitsize()
      The currently set effective size for an undefined wildcard type. If 0, it means the effective size is unknown and should be considered equal to the maximum size.
      Returns:
      possibly 0 if undetermined
    • getSlotCount

      int getSlotCount()
      Determine the number of stack slots currently required to accommodate this wildcard type.
      Returns:
    • getGroup

      Returns:
      possibly null if unknown
    • isFloat

      boolean isFloat()
      Returns:
    • isSigned

      boolean isSigned()
      Determine whether this wildcard type represents a signed integer (it could be defined or partially defined).
      Returns:
    • isUnsigned

      boolean isUnsigned()
      Determine whether this wildcard type represents an unsigned integer (it could be defined or partially defined).
      Returns:
    • isInteger

      default boolean isInteger()
      Determine whether this wildcard type represents an integer (it could be defined or partially defined).
      Returns:
    • isPointer

      boolean isPointer()
      Returns:
    • isWildcardPointer

      boolean isWildcardPointer()
      Returns:
    • getPointedBitsize

      int getPointedBitsize()
      Returns:
      possibly 0 if unknown
    • getPointedSize

      int getPointedSize()
      Returns:
      possibly 0 if unknown
    • getPointedGroup

      IWildcardType.Group getPointedGroup()
      Returns:
      possibly null if unknown
    • updateEffectiveBitsize

      IWildcardType updateEffectiveBitsize(int newEffectiveBitsize)
      Parameters:
      newEffectiveBitsize -
      Returns:
    • updateMaxBitsize

      IWildcardType updateMaxBitsize(int newMaxBitsize)
      Parameters:
      newMaxBitsize -
      Returns:
    • updateGroup

      IWildcardType updateGroup(IWildcardType.Group group)
      Parameters:
      group -
      Returns:
    • updatePointedBitsize

      IWildcardType updatePointedBitsize(int newPointedBitsize)
      Parameters:
      newPointedBitsize -
      Returns:
    • updatePointedGroup

      IWildcardType updatePointedGroup(IWildcardType.Group newPointedGroup)
      Parameters:
      newPointedGroup -
      Returns:
    • isLessSpecializedThan

      boolean isLessSpecializedThan(IWildcardType o)
      Determine if this wildcard type appears to be less specialized than the provided parameter wildcard type.

      Note: "Specialized" within the context of this class and wildcard types has a meaning different than the one used by type systems for hierarchy of type objects.

      Same as compareTo(o)<0

      Parameters:
      o - another type
      Returns:
    • isDefined

      boolean isDefined()
      Determine if this wildcard type is fully defined, ie, it wraps a native type.
      Returns:
    • isResolved

      default boolean isResolved()
      Determine if this wildcard type is fully defined, ie, it wraps a native type.

      Same as isDefined().

      Returns:
    • isPartiallyDefined

      boolean isPartiallyDefined()
      Determine if this wildcard type is partially defined: it does not wrap a native type, but does contain preliminary type information, such as the effective size, group, signedness, etc.
      Returns:
    • isUndefined

      boolean isUndefined()
      Determine if this wildcard type is entirely undefined: it does not wrap a native type and does not contain any preliminary type information.
      Returns:
    • isUpdatable

      boolean isUpdatable()
      Determine if this wildcard type can be updated. Undefined wildcard types can be updated, whereas most defined wildcard types (wrapping native types) cannot be updated, except for some primitives.

      Note that wildcard types are immutable, the process of updating them will always yield the creation of a new wildcard type.

      Returns:
    • resolveU

      IWildcardType resolveU()
      Resolve the wildcard type, ie, generate a defined wildcard type (wrapping a primitive) from this possibly undefined wildcard type.

      This method throws an IllegalStateException on error (if the wildcard type cannot be resolved).

      Returns:
      never null
    • resolveA

      IWildcardType resolveA()
      Attempt to resolve the wildcard type, ie, generate a defined wildcard type (wrapping a primitive) from this possibly undefined wildcard type.

      This method does not throw on error (if the wildcard type cannot be resolved). To determine whether or not the returned type was really resolved, use isResolved().

      Returns:
      a resolved type or the same (this) type if the resolution failed
    • toString

      String toString(boolean compact)
      Generate a string representation of this wildcard type. Examples with slotsize= 32 bits:
       ??       => slot=1, esize=unk, group=unk (normal representation)
       ?        => slot=1, esize=unk, group=unk (same, compact representation)
       ??32     => slot=1, esize=32,  group=unk (normal representation)
       ?32      => slot=1, esize=32,  group=unk (same, compact representation)
       ??/64    => slot=2, esize=unk, group=unk
       ??32/64  => slot=2, esize=32,  group=unk
       ?I       => slot=1, esize=unk, group=int
       ?I32     => slot=1, esize=32,  group=int
       ?U       =>
       ?U64     => slot=2, esize=64,  group=uint (note that 2 full slots are used, but /64 is not appended since it matches the esize)
       ?F       =>
       ?F32     =>
       ?F64     =>
       ?F32/64  =>
       ?F/64    =>
       ?P       => slot=1, psize=unk, group=ptr
       ?P32     => slot=1, psize=32,  group=ptr
       ?P32/64  => slot=2, psize=32,  group=ptr
       
       
      Parameters:
      compact - true to generate a compact representation: avoid double '?' sequences, do not append the physical bitsize ('/NN') after the type in cases where it's not equal to a slot size
      Returns:
      a string representation of the type
    • toString

      String toString()
      Generate a compact representation of the type. Same as toString(true).
      Overrides:
      toString in class Object
      Returns:
      a compact representation of the type
    • updateProperties

      IWildcardType updateProperties(IWildcardType srctype)
      Soft-transfer the properties of a source type to this type.
      Parameters:
      srctype -
      Returns:
      a new type (or this type if no update was performed)
    • getLayoutInfo

      TypeLayoutInfo getLayoutInfo()
      Returns:
    • isEquivalent

      boolean isEquivalent(IWildcardType otherType)
      An extended equality check, that checks unaliased native types (if both wildcard types are resolved).
      Parameters:
      otherType -
      Returns: