001/**
002 * Unit-API - Units of Measurement API for Java
003 * Copyright (c) 2014 Jean-Marie Dautelle, Werner Keil, V2COM
004 * All rights reserved.
005 *
006 * See LICENSE.txt for details.
007 */
008package javax.measure;
009
010
011/**
012 * Signals that a problem of some sort has occurred due to incommensurable of
013 * some quantities/units. Only commensurable quantity (quantities with the same
014 * dimensions) may be compared, equated, added, or subtracted. Also, one unit
015 * can be converted to another unit only if both units are commensurable.
016 * <p>
017 * This is a <strong>checked</strong> exception, so it deliberately doesn't
018 * inherit from <code>MeasurementException</code> like most other exceptions.
019 * </p>
020 * @author <a href="mailto:[email protected]">Jean-Marie Dautelle</a>
021 * @author <a href="mailto:[email protected]">Werner Keil</a>
022 * @version 0.15, $Date: 2014-06-28 $
023 *
024 * @see <a href="http://en.wikipedia.org/wiki/Unit_commensurability#Commensurability">Wikipedia: Unit Commensurability</a>
025 */
026public class IncommensurableException extends Exception {
027    /**
028     * For cross-version compatibility.
029     */
030    //private static final long serialVersionUID = -3676414292638136515L;
031
032    /**
033     * Constructs a {@code IncommensurableException} with the given message.
034     *
035     * @param message the detail message, or {@code null} if none.
036     */
037    public IncommensurableException(final String message) {
038        super(message);
039    }
040
041    /**
042     * Constructs a {@code IncommensurableException} with the given cause.
043     *
044     * @param cause the cause of this exception, or {@code null} if none.
045     *
046     */
047    public IncommensurableException(final Throwable cause) {
048        super(cause);
049    }
050
051    /**
052     * Constructs a {@code IncommensurableException} with the given message and cause.
053     *
054     * @param message the detail message, or {@code null} if none.
055     * @param cause the cause of this exception, or {@code null} if none.
056     *
057     */
058    public IncommensurableException(final String message, final Throwable cause) {
059        super(message, cause);
060    }
061}