ice.util.unit
Class Unit

java.lang.Object
  extended byice.util.unit.Unit
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
CmUnit, InchUnit, MmUnit, PointUnit

public abstract class Unit
extends Object
implements Cloneable

Base class for the measurment system in the print framework. When adding a new measurement unit to the framework you must extend this class and implement the getPoint().

Since:
6.0
Author:
Jean-Pierre Dube

Constructor Summary
Unit()
          Constructor: PFUnit
Unit(double parUnits)
          Constructor: PFUnit
 
Method Summary
 Unit add(double parUnits)
          Add a double value to this unit.
 Unit add(Unit parUnits)
          Add another measurement system value to this unit.
 Object clone()
           
 Unit divide(double parUnits)
          Divide a double value to this unit.
 Unit divide(Unit parUnits)
          Divide another measurement system value to this unit.
 boolean equals(Object parUnit)
           
abstract  double getPoints()
          This method is in charge of converting the unit value in the current measurement system to points.
 double getUnits()
          Get the units in the implemented measurement system.
 Unit multiply(double parUnits)
          Multiply a double value to this unit.
 Unit multiply(Unit parUnits)
          Multiply another measurement system value to this unit.
abstract  void setPoints(double parPoints)
          Set the value of this object in points a convert the value to the current measurment system define by the class.
 void setUnits(double parUnits)
          Set the unit value, using the implemented unit of measurment.
 Unit substract(double parUnits)
          Substract a double value to this unit.
 Unit substract(Unit parUnits)
          Method: substract
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Unit

public Unit()
Constructor: PFUnit


Unit

public Unit(double parUnits)
Constructor: PFUnit

Parameters:
parUnits - a value of type double
Method Detail

setUnits

public void setUnits(double parUnits)
Set the unit value, using the implemented unit of measurment.

Parameters:
parUnits - a value of type double

getUnits

public double getUnits()
Get the units in the implemented measurement system.

Returns:
a value of type double

getPoints

public abstract double getPoints()
This method is in charge of converting the unit value in the current measurement system to points.

Returns:
a value of type double

setPoints

public abstract void setPoints(double parPoints)
Set the value of this object in points a convert the value to the current measurment system define by the class.

Parameters:
parPoints - a value of type double

add

public Unit add(Unit parUnits)
Add another measurement system value to this unit.

Parameters:
parUnits - a value of type PFUnit

add

public Unit add(double parUnits)
Add a double value to this unit. Note that the value passed in parameters is assumed to be in the current units defined by this object.

Parameters:
parUnits - a value of type Unit

substract

public Unit substract(Unit parUnits)
Method: substract

Substract another measurement system value to this unit.

Parameters:
parUnits - a value of type Unit

substract

public Unit substract(double parUnits)
Substract a double value to this unit. Note that the value passed in parameters is assumed to be in the current units defined by this object.

Parameters:
parUnits - a value of type Unit
Returns:
a value of type Unit

multiply

public Unit multiply(Unit parUnits)
Multiply another measurement system value to this unit.

Parameters:
parUnits - a value of type Unit

multiply

public Unit multiply(double parUnits)
Multiply a double value to this unit. Note that the value passed in parameters is assumed to be in the current units defined by this object.

Parameters:
parUnits - a value of type double

divide

public Unit divide(Unit parUnits)
Divide another measurement system value to this unit. Note: A denominator with a zero value will be trapped and a null value will be returned.

Parameters:
parUnits - a value of type Unit

divide

public Unit divide(double parUnits)
Divide a double value to this unit. Note that the value passed in parameters is assumed to be in the current units defined by this object. Note: A denominator with a zero value will be trapped and a null value will be returned.

Parameters:
parUnits - a value of type double

equals

public boolean equals(Object parUnit)
Parameters:
parUnit - a value of type Object
Returns:
a value of type boolean

clone

public Object clone()
Returns:
a value of type Object

toString

public String toString()
Returns:
a value of type String