byucc.edif
Class ExpValue

java.lang.Object
  extended bybyucc.edif.ExpValue
All Implemented Interfaces:
java.io.Serializable

public class ExpValue
extends java.lang.Object
implements java.io.Serializable

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

Version:
$Id: ExpValue.java,v 1.6 2004/08/27 19:16:42 tsa6 Exp $
Author:
Welson Sun, Mike Wirthlin, Tyler Anderson
See Also:
Serialized Form

Field Summary
private  int _base
          The base number of this object.
private  int _exp
          The exponent (in powers of 10) of the base number.
 
Constructor Summary
ExpValue(int base, int exp)
          Constructs an ExpValue Object with the specified base and exponent.
 
Method Summary
 java.lang.Object clone()
          Returns a copy or clone of this object.
 boolean equals(ExpValue cmp)
          Returns true if the values in this Object equal or match that of the passed-in one.
 int getBase()
          Returns the base value of this object.
 int getExp()
          Returns the exponent of this object.
 double getValue()
          Returns 10 raised to the exponent timed by the base number.
 java.lang.String toString()
          Returns a String representation of this Object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_base

private int _base
The base number of this object.


_exp

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

Constructor Detail

ExpValue

public ExpValue(int base,
                int exp)
Constructs 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

clone

public java.lang.Object clone()
Returns a copy or clone of this object.

Returns:
An Object that is a copy or clone of this ExpValue

equals

public boolean equals(ExpValue cmp)
Returns true if the values in this Object equal or match that of the passed-in one.

Parameters:
cmp - The Object to match the values of this Object with
Returns:
True if the values in this Object match or equal those in the passed-in one

getBase

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

Returns:
An int representing the base value of this object

getExp

public int getExp()
Returns 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()
Returns 10 raised to the exponent timed by the base number.

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

toString

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

Returns:
A String representing this object's base and exponent