edu.byu.ece.edif.core
Class ExpValue

java.lang.Object
  extended by edu.byu.ece.edif.core.ScaledInteger
      extended by edu.byu.ece.edif.core.ExpValue
All Implemented Interfaces:
EdifOut, EdifTypedValue, java.io.Serializable

public class ExpValue
extends ScaledInteger

Represents a base number with an exponent value. This object is immutable.

Version:
$Id:ExpValue.java 198 2008-04-16 21:14:21Z jamesfcarroll $
See Also:
Serialized Form

Field Summary
private  int _exp
          The exponent (in powers of 10) of the base number.
 
Fields inherited from class edu.byu.ece.edif.core.ScaledInteger
_integerValue
 
Constructor Summary
ExpValue(int base, int exp)
          Construct an ExpValue Object with the specified base and exponent.
 
Method Summary
 boolean equals(EdifTypedValue value)
           
 int getBase()
          Return the base value of this object.
 int getExp()
          Return the exponent of this object.
 double getValue()
          Return 10 raised to the exponent multiplied by the base number.
 void toEdif(EdifPrintWriter epw)
          Convert this object to EDIF format and write it to the passed in EdifPrintWriter Object.
 java.lang.String toString()
          Return a String representation of this Object.
 
Methods inherited from class edu.byu.ece.edif.core.ScaledInteger
getIntegerValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_exp

private int _exp
The exponent (in powers of 10) of the base number.

Constructor Detail

ExpValue

public ExpValue(int base,
                int exp)
Construct an ExpValue Object with the specified base and exponent.

Parameters:
base - The base number
exp - The base number is raised to this exponent
Method Detail

equals

public boolean equals(EdifTypedValue value)
Specified by:
equals in interface EdifTypedValue
Overrides:
equals in class ScaledInteger

getBase

public int getBase()
Return the base value of this object.

Returns:
An int representing the base value of this object

getExp

public int getExp()
Return the exponent of this object.

Returns:
An int representing what exponent the base number is raised to (in powers of 10)

getValue

public double getValue()
Return 10 raised to the exponent multiplied by the base number.

Returns:
An int representing (10^exp)*base

toEdif

public void toEdif(EdifPrintWriter epw)
Convert this object to EDIF format and write it to the passed in EdifPrintWriter Object.

Specified by:
toEdif in interface EdifOut
Overrides:
toEdif in class ScaledInteger
Parameters:
epw - The EdifPrintWriter Object that the EDIF data will be written to

toString

public java.lang.String toString()
Return a String representation of this Object.

Overrides:
toString in class ScaledInteger
Returns:
A String representing this object's base and exponent