fr.inria.opengve.bridge.abstractClasses
Class AbstractScalar

java.lang.Object
  extended by java.lang.Number
      extended by fr.inria.opengve.bridge.abstractClasses.AbstractScalar
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<AbstractScalar>

public abstract class AbstractScalar
extends java.lang.Number
implements java.lang.Comparable<AbstractScalar>, java.lang.Cloneable

This Class is used everywhere numerics computations must be done without specify the type of the of the scalar. This class implement all data types independant code. You must note that this object is not immutable and so calling numerical operations modify the calling object.

Author:
fabrice.peix@sophia.inria.fr
See Also:
Serialized Form

Constructor Summary
AbstractScalar()
           
 
Method Summary
abstract  AbstractScalar abs()
          Set the value this AbstractScalar to the absolute value of this AbstractScalar.
abstract  AbstractScalar add(AbstractScalar c)
          Add an AbstractScalar to this object.
 AbstractScalar clone()
           
abstract  AbstractScalar divide(AbstractScalar c)
          Divide this object by an AbstractScalar.
abstract  AbstractScalar exp()
          Set the value of this AbstractScalar to the exponential value of this AbstractScalar.
abstract  AbstractScalar log()
          Set the value this AbstractScalar to the log of this AbstractScalar.
abstract  AbstractScalar log10()
          Set the value this AbstractScalar to the log10 of this AbstractScalar.
static
<A extends AbstractScalar>
A
Max(A v1, A v2)
          Compare two AbstractScalar and return the greatest.
static
<A extends AbstractScalar>
A
Min(A v1, A v2)
          Compare two AbstractScalar and return the smallest.
abstract  AbstractScalar multiply(AbstractScalar c)
          Multiply this object by an AbstractScalar.
abstract  AbstractScalar negate()
          Change the value of this AbstractScalar to the opposite.
abstract  AbstractScalar pow(AbstractScalar c)
          Set the value of this AbstractScalar to this^c.
abstract  AbstractScalar sqrt()
          Set this AbstractScalar to sqare root of this.
abstract  AbstractScalar subtract(AbstractScalar c)
          Subtract an AbstractScalar to this object.
abstract  java.lang.String toString()
           
abstract  AbstractScalar zero()
          Return an AbstractScalar of the same type of this AbstractScalar with a value of zero.
 
Methods inherited from class java.lang.Number
byteValue, doubleValue, floatValue, intValue, longValue, shortValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

AbstractScalar

public AbstractScalar()
Method Detail

Max

public static final <A extends AbstractScalar> A Max(A v1,
                                                     A v2)
Compare two AbstractScalar and return the greatest.

Parameters:
v1 - The first AbstractScalar.
v2 - The second AbstractScalar.
Returns:
The greatest AbstractScalar between v1 and v2. If v1 and v2 are equals v1 is returned.

Min

public static final <A extends AbstractScalar> A Min(A v1,
                                                     A v2)
Compare two AbstractScalar and return the smallest.

Parameters:
v1 - The first AbstractScalar.
v2 - The second AbstractScalar.
Returns:
The smallest AbstractScalar between v1 and v2. If v1 and v2 are equal v2 is returned.

zero

public abstract AbstractScalar zero()
Return an AbstractScalar of the same type of this AbstractScalar with a value of zero.

Returns:
An AbstractScalar of the same type of this AbstractScalar with a value of zero.

add

public abstract AbstractScalar add(AbstractScalar c)
Add an AbstractScalar to this object.

Parameters:
c - The AbstractScalar to add to this object.
Returns:
This object.

subtract

public abstract AbstractScalar subtract(AbstractScalar c)
Subtract an AbstractScalar to this object.

Parameters:
c - The AbstractScalar to subtract to this object.
Returns:
This object.

multiply

public abstract AbstractScalar multiply(AbstractScalar c)
Multiply this object by an AbstractScalar.

Parameters:
c - The AbstractScalar to multiply with this object.
Returns:
This object.

divide

public abstract AbstractScalar divide(AbstractScalar c)
Divide this object by an AbstractScalar.

Parameters:
c - The AbstractScalar dividing this object.
Returns:
This object.

negate

public abstract AbstractScalar negate()
Change the value of this AbstractScalar to the opposite.

Returns:
This object.

exp

public abstract AbstractScalar exp()
                            throws java.lang.Exception
Set the value of this AbstractScalar to the exponential value of this AbstractScalar.

Returns:
This object.
Throws:
java.lang.Exception - If this AbstractScalar must be integer.

abs

public abstract AbstractScalar abs()
Set the value this AbstractScalar to the absolute value of this AbstractScalar.

Returns:
This object.

log

public abstract AbstractScalar log()
                            throws java.lang.Exception
Set the value this AbstractScalar to the log of this AbstractScalar.

Throws:
java.lang.Exception - If this AbstractScalar must be integer.

log10

public abstract AbstractScalar log10()
                              throws java.lang.Exception
Set the value this AbstractScalar to the log10 of this AbstractScalar.

Throws:
java.lang.Exception - If this AbstractScalar must be integer.

pow

public abstract AbstractScalar pow(AbstractScalar c)
Set the value of this AbstractScalar to this^c.

Parameters:
c - The exponent.

sqrt

public abstract AbstractScalar sqrt()
                             throws java.lang.Exception
Set this AbstractScalar to sqare root of this.

Throws:
java.lang.Exception - If this AbstractScalar must be integer.

toString

public abstract java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public AbstractScalar clone()
Overrides:
clone in class java.lang.Object


Copyright © 2009 INRIA (Projet Mascotte). All Rights Reserved.