byucc.edif
Class ExpValue

java.lang.Object
  extended by byucc.edif.ScaledInteger
      extended by byucc.edif.ExpValue
All Implemented Interfaces:
EdifOut, EdifTypedValue

public class ExpValue
extends ScaledInteger

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

Version:
$Id: ExpValue.java,v 1.13 2006/07/23 01:09:20 jonjohn Exp $

Field Summary
private  int _exp
          The exponent (in powers of 10) of the base number.
 
Fields inherited from class byucc.edif.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.
 java.lang.String toString()
          Return a String representation of this Object.
 
Methods inherited from class byucc.edif.ScaledInteger
getIntegerValue, toEdif
 
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

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