Class MaxValueRealTypes


  • public class MaxValueRealTypes
    extends Object
    This collection of Ops can be used to obtain the maximum value of any RealType. This method of determining the maximum value of a RealType is preferable since it is safe and extensible.
    Author:
    Gabriel Selzer
    • Field Detail

      • maxBitType

        public final Function<BitType,​BitType> maxBitType
        Output parameters:
        maxValue - a {@link BitType} containing the maximum value of a bit
        Input parameters:
        in - some {@link BitType}
        Implementation Note:
        op names='types.maxValue'
      • maxBoolType

        public final Function<BoolType,​BoolType> maxBoolType
        Output parameters:
        maxValue boolean - e} containing the maximum value of a boolean
        Input parameters:
        in - some {@link BoolType}
        Implementation Note:
        op names='types.maxValue'
      • maxNativeBoolType

        public final Function<NativeBoolType,​NativeBoolType> maxNativeBoolType
        Output parameters:
        maxValue boolean - oolType} containing the maximum value of a boolean
        Input parameters:
        in - some {@link NativeBoolType}
        Implementation Note:
        op names='types.maxValue'
      • maxByteType

        public final Function<ByteType,​ByteType> maxByteType
        Output parameters:
        maxValue - a {@link ByteType} containing the maximum value of a byte
        Input parameters:
        in - some {@link ByteType}
        Implementation Note:
        op names='types.maxValue'
      • maxUnsignedByteType

        public final Function<UnsignedByteType,​UnsignedByteType> maxUnsignedByteType
        Output parameters:
        maxValue an unsigned byte - } containing the maximum value of an unsigned byte
        Input parameters:
        in - some {@link UnsignedByteType}
        Implementation Note:
        op names='types.maxValue'
      • maxIntType

        public final Function<IntType,​IntType> maxIntType
        Output parameters:
        maxValue - a {@link IntType} containing the maximum value of an int
        Input parameters:
        in - some {@link IntType}
        Implementation Note:
        op names='types.maxValue'
      • maxUnsignedIntType

        public final Function<UnsignedIntType,​UnsignedIntType> maxUnsignedIntType
        Output parameters:
        maxValue an unsigned int - } containing the maximum value of an unsigned int
        Input parameters:
        in - some {@link UnsignedIntType}
        Implementation Note:
        op names='types.maxValue'
      • maxLongType

        public final Function<LongType,​LongType> maxLongType
        Output parameters:
        maxValue - a {@link LongType} containing the maximum value of a long
        Input parameters:
        in - some {@link LongType}
        Implementation Note:
        op names='types.maxValue'
      • maxUnsignedLongType

        public final Function<UnsignedLongType,​UnsignedLongType> maxUnsignedLongType
        Output parameters:
        maxValue an unsigned long - } containing the maximum value of an unsigned long
        Input parameters:
        in - some {@link UnsignedLongType}
        Implementation Note:
        op names='types.maxValue'
      • maxShortType

        public final Function<ShortType,​ShortType> maxShortType
        Output parameters:
        maxValue short - Type} containing the maximum value of a short
        Input parameters:
        in - some {@link ShortType}
        Implementation Note:
        op names='types.maxValue'
      • maxUnsignedShortType

        public final Function<UnsignedShortType,​UnsignedShortType> maxUnsignedShortType
        Output parameters:
        maxValue of an unsigned short - ontaining the maximum value of an unsigned short
        Input parameters:
        in - some {@link UnsignedShortType}
        Implementation Note:
        op names='types.maxValue'
      • maxFloatType

        public final Function<FloatType,​FloatType> maxFloatType
        Output parameters:
        maxValue 32-bit floating point value - aximum value of a 32-bit floating point value
        Input parameters:
        in - some {@link FloatType}
        Implementation Note:
        op names='types.maxValue'
      • maxDoubleType

        public final Function<DoubleType,​DoubleType> maxDoubleType
        Output parameters:
        maxValue 64-bit floating point value - maximum value of a 64-bit floating point value
        Input parameters:
        in - some {@link DoubleType}
        Implementation Note:
        op names='types.maxValue'
      • max2BitType

        public final Function<Unsigned2BitType,​Unsigned2BitType> max2BitType
        Output parameters:
        maxValue a 2-bit data structure - aining the maximum value of a 2-bit data structure
        Input parameters:
        in - some {@link Unsigned2BitType}
        Implementation Note:
        op names='types.maxValue'
      • max4BitType

        public final Function<Unsigned4BitType,​Unsigned4BitType> max4BitType
        Output parameters:
        maxValue a 4-bit data structure - aining the maximum value of a 4-bit data structure
        Input parameters:
        in - some {@link Unsigned4BitType}
        Implementation Note:
        op names='types.maxValue'
      • max12BitType

        public final Function<Unsigned12BitType,​Unsigned12BitType> max12BitType
        Output parameters:
        maxValue of a 12-bit data structure - ing the maximum value of a 12-bit data structure
        Input parameters:
        in - some {@link Unsigned12BitType}
        Implementation Note:
        op names='types.maxValue'
      • max128BitType

        public final Function<Unsigned128BitType,​Unsigned128BitType> max128BitType
        Output parameters:
        maxValue of a 128-bit data structure - ing the maximum value of a 128-bit data structure
        Input parameters:
        in - some {@link Unsigned128BitType}
        Implementation Note:
        op names='types.maxValue'
      • maxVarLengthType

        public final Function<UnsignedVariableBitLengthType,​UnsignedVariableBitLengthType> maxVarLengthType
        Due to the variable length of this type, we cannot simply return some final value. The best we can do is quickly compute the answer. Note that so long as the bit length of the type is less than 64, we can losslessly compute the maximum within long math. If it is 64 or larger, we must use BigInteger (this should never happen in practice since UnsignedLongType is more efficient as a 64 bit type and bit lengths greater than 64 are unsupported). TODO: Is there some way we could cache the values? Is that worth it??
        Output parameters:
        maxValue maximum value storable in {@code in} - ining the maximum value storable in {@code in}
        Input parameters:
        in - some {@link UnsignedVariableBitLengthType}
        Implementation Note:
        op names='types.maxValue'
    • Constructor Detail

      • MaxValueRealTypes

        public MaxValueRealTypes()