Enum PrimitiveWideningDelegate

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PrimitiveWideningDelegate>

    public enum PrimitiveWideningDelegate
    extends java.lang.Enum<PrimitiveWideningDelegate>
    This delegate is responsible for widening a primitive type to represent a larger primitive type. The rules for this widening are equivalent to those in the JLS.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      BOOLEAN
      The widening delegate for boolean values.
      BYTE
      The widening delegate for byte values.
      CHARACTER
      The widening delegate for char values.
      DOUBLE
      The widening delegate for double values.
      FLOAT
      The widening delegate for float values.
      INTEGER
      The widening delegate for int values.
      LONG
      The widening delegate for long values.
      SHORT
      The widening delegate for short values.
    • Method Detail

      • values

        public static PrimitiveWideningDelegate[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (PrimitiveWideningDelegate c : PrimitiveWideningDelegate.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PrimitiveWideningDelegate valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • forPrimitive

        public static PrimitiveWideningDelegate forPrimitive​(TypeDefinition typeDefinition)
        Locates the delegate that is capable of widening the given type into another type.
        Parameters:
        typeDefinition - A non-void primitive type that is to be widened into another type.
        Returns:
        A delegate for the given type.
      • widenTo

        public StackManipulation widenTo​(TypeDefinition typeDefinition)
        Attempts to widen the represented type into another type.
        Parameters:
        typeDefinition - A non-void primitive type that is the expected result of the widening operation.
        Returns:
        A widening instruction or an illegal stack manipulation if such widening is not legitimate.