Package javax.measure

Class IncommensurableException

  • All Implemented Interfaces:
    java.io.Serializable

    public class IncommensurableException
    extends java.lang.Exception
    Signals that a problem of some sort has occurred due to incommensurable of some quantities/units. Only commensurable quantity (quantities with the same dimensions) may be compared, equated, added, or subtracted. Also, one unit can be converted to another unit only if both units are commensurable.

    This is a checked exception, so it deliberately doesn't inherit from MeasurementException like most other exceptions.

    Since:
    1.0
    Version:
    1.0, August 8, 2016
    See Also:
    Wikipedia: Unit Commensurability, Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static long serialVersionUID
      For cross-version compatibility.
    • Constructor Summary

      Constructors 
      Constructor Description
      IncommensurableException​(java.lang.String message)
      Constructs a IncommensurableException with the given message.
      IncommensurableException​(java.lang.String message, java.lang.Throwable cause)
      Constructs a IncommensurableException with the given message and cause.
      IncommensurableException​(java.lang.Throwable cause)
      Constructs a IncommensurableException with the given cause.
    • Method Summary

      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        For cross-version compatibility.
        See Also:
        Constant Field Values
    • Constructor Detail

      • IncommensurableException

        public IncommensurableException​(java.lang.String message)
        Constructs a IncommensurableException with the given message.
        Parameters:
        message - the detail message, or null if none.
      • IncommensurableException

        public IncommensurableException​(java.lang.Throwable cause)
        Constructs a IncommensurableException with the given cause.
        Parameters:
        cause - the cause of this exception, or null if none.
      • IncommensurableException

        public IncommensurableException​(java.lang.String message,
                                        java.lang.Throwable cause)
        Constructs a IncommensurableException with the given message and cause.
        Parameters:
        message - the detail message, or null if none.
        cause - the cause of this exception, or null if none.