Interface NTGenericAmountType

All Superinterfaces:
java.lang.Comparable<NTGenericAmountType>
All Known Implementing Classes:
NTGenericAmount

@Immutable
public interface NTGenericAmountType
extends java.lang.Comparable<NTGenericAmountType>
See Also:
"SoundFontⓡ Technical Specification 2.04, §7.5 The PGEN subchunk"
  • Method Summary

    Modifier and Type Method Description
    default short asSigned16()
    Treat the amount as if it was a signed 16-bit value, and return it.
    default char asUnsigned16()
    Treat the amount as if it was an unsigned 16-bit value, and return it.
    default int asUnsignedBytesHigh()
    Treat the amount as if it were two separate unsigned bytes, and return the high byte
    default int asUnsignedBytesLow()
    Treat the amount as if it were two separate unsigned bytes, and return the low byte
    default void checkPreconditions()
    Check preconditions for the type.
    default int compareTo​(NTGenericAmountType other)  
    int value()  
  • Method Details

    • value

      @Parameter int value()
      Returns:
      The raw value in the range [0, 0xffff]
    • asUnsignedBytesLow

      default int asUnsignedBytesLow()
      Treat the amount as if it were two separate unsigned bytes, and return the low byte
      Returns:
      The unsigned byte value
    • asUnsignedBytesHigh

      default int asUnsignedBytesHigh()
      Treat the amount as if it were two separate unsigned bytes, and return the high byte
      Returns:
      The unsigned byte value
    • asUnsigned16

      default char asUnsigned16()
      Treat the amount as if it was an unsigned 16-bit value, and return it.
      Returns:
      The unsigned 16-bit value
    • asSigned16

      default short asSigned16()
      Treat the amount as if it was a signed 16-bit value, and return it.
      Returns:
      The signed 16-bit value
    • compareTo

      default int compareTo​(NTGenericAmountType other)
      Specified by:
      compareTo in interface java.lang.Comparable<NTGenericAmountType>
    • checkPreconditions

      @Check default void checkPreconditions()
      Check preconditions for the type.