KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jscience > mathematics > numbers > Numeric


1 /*
2  * JScience - Java(TM) Tools and Libraries for the Advancement of Sciences.
3  * Copyright (C) 2005 - JScience (http://jscience.org/)
4  * All rights reserved.
5  *
6  * Permission to use, copy, modify, and distribute this software is
7  * freely granted, provided that this notice is preserved.
8  */

9 package org.jscience.mathematics.numbers;
10
11 import org.jscience.mathematics.matrices.Operable;
12
13 /**
14  * <p> This interface identifies {@link Operable operables} for which the
15  * length, size, or extent can be calculated (see {@link #norm()}).</p>
16  *
17  * @author <a HREF="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
18  * @version 2.0, June 6, 2004
19  * @see <a HREF="http://mathworld.wolfram.com/Norm.html">
20  * Norm -- from MathWorld</a>
21  */

22 public interface Numeric<T extends Numeric<T>> extends Operable<T> {
23
24     /**
25      * Compares the {@link #norm norm} of this numeric with that numeric.
26      *
27      * @param that the numeric to be compared with.
28      * @return <code>|this| > |that|</code>
29      */

30     boolean isLargerThan(T that);
31
32     /**
33      * Returns the norm (or magnitude) of this numeric.
34      *
35      * @return <code>|this|</code>
36      */

37     T norm();
38
39     /**
40      * Returns the square root of this numeric.
41      *
42      * @return the numeric <code>sqrt</code> such as
43      * <code>sqrt.times(sqrt) = this</code>
44      * @throws ArithmeticException if the square root cannot be calculated.
45      */

46     T sqrt();
47     
48 }
49
Popular Tags