edu.iris.Fissures.model
Class QuantityImpl

java.lang.Object
  extended by edu.iris.Fissures.Quantity
      extended by edu.iris.Fissures.model.QuantityImpl
All Implemented Interfaces:
java.io.Serializable, org.omg.CORBA.portable.IDLEntity, org.omg.CORBA.portable.Streamable, org.omg.CORBA.portable.StreamableValue, org.omg.CORBA.portable.ValueBase
Direct Known Subclasses:
TimeInterval

public class QuantityImpl
extends edu.iris.Fissures.Quantity

QuantityImpl.java Created: Wed Sep 1 17:43:50 1999

See Also:
Serialized Form

Field Summary
protected  java.text.NumberFormat format
           
 
Fields inherited from class edu.iris.Fissures.Quantity
the_units, value
 
Constructor Summary
protected QuantityImpl()
           
  QuantityImpl(double f, edu.iris.Fissures.Unit the_unit)
           
 
Method Summary
 QuantityImpl abs()
           
 QuantityImpl add(QuantityImpl q)
           
 QuantityImpl convertTo(UnitImpl newUnit)
          converts this Quantity into the given units.
static java.io.Serializable createEmpty()
           
static QuantityImpl createQuantityImpl(edu.iris.Fissures.Quantity q)
           
 QuantityImpl divideBy(double f)
           
 QuantityImpl divideBy(QuantityImpl q)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String formatValue(java.lang.String format)
           
 UnitImpl get_unit()
           
 double get_value()
           
 UnitImpl getUnit()
           
 double getValue()
           
 double getValue(UnitImpl unit)
           
 boolean greaterThan(QuantityImpl q)
           
 boolean greaterThanEqual(QuantityImpl q)
           
 int hashCode()
           
 QuantityImpl inverse()
           
 boolean lessThan(QuantityImpl q)
           
 boolean lessThanEqual(QuantityImpl q)
           
static void main(java.lang.String[] args)
           
 QuantityImpl multiplyBy(double f)
           
 QuantityImpl multiplyBy(QuantityImpl q)
           
 void setDecimalFormat(java.lang.String format)
          Sets the format using a java DecimalFormat.
 void setFormat(java.text.NumberFormat format)
           
protected  void setUnit(UnitImpl unit)
           
protected  void setValue(double value)
           
 QuantityImpl subtract(QuantityImpl q)
           
 java.lang.String toString()
           
 
Methods inherited from class edu.iris.Fissures.Quantity
_read, _truncatable_ids, _type, _write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

format

protected java.text.NumberFormat format
Constructor Detail

QuantityImpl

protected QuantityImpl()

QuantityImpl

public QuantityImpl(double f,
                    edu.iris.Fissures.Unit the_unit)
Method Detail

createEmpty

public static java.io.Serializable createEmpty()

createQuantityImpl

public static QuantityImpl createQuantityImpl(edu.iris.Fissures.Quantity q)

setDecimalFormat

public void setDecimalFormat(java.lang.String format)
Sets the format using a java DecimalFormat.

Parameters:
format -
See Also:
http://java.sun.com/j2se/1.5.0/docs/api/java/text/DecimalFormat.html

setFormat

public void setFormat(java.text.NumberFormat format)

formatValue

public java.lang.String formatValue(java.lang.String format)

getValue

public double getValue()

getValue

public double getValue(UnitImpl unit)

setValue

protected void setValue(double value)

get_value

public double get_value()

getUnit

public UnitImpl getUnit()

setUnit

protected void setUnit(UnitImpl unit)

get_unit

public UnitImpl get_unit()

convertTo

public QuantityImpl convertTo(UnitImpl newUnit)
converts this Quantity into the given units.

Throws:
java.lang.IllegalArgumentException - if the given units are not compatible.

add

public QuantityImpl add(QuantityImpl q)

subtract

public QuantityImpl subtract(QuantityImpl q)

multiplyBy

public QuantityImpl multiplyBy(QuantityImpl q)

divideBy

public QuantityImpl divideBy(QuantityImpl q)

multiplyBy

public QuantityImpl multiplyBy(double f)

divideBy

public QuantityImpl divideBy(double f)

abs

public QuantityImpl abs()

inverse

public QuantityImpl inverse()

toString

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

greaterThan

public boolean greaterThan(QuantityImpl q)

greaterThanEqual

public boolean greaterThanEqual(QuantityImpl q)

lessThan

public boolean lessThan(QuantityImpl q)

lessThanEqual

public boolean lessThanEqual(QuantityImpl q)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

main

public static void main(java.lang.String[] args)