byucc.edif
Class ScaledInteger

java.lang.Object
  extended by byucc.edif.ScaledInteger
All Implemented Interfaces:
EdifOut, java.io.Serializable

public class ScaledInteger
extends java.lang.Object
implements EdifOut, java.io.Serializable

Represents an integer that can hold either of two types: int, and ExpValue.

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

Field Summary
private  ExpValue _expValue
          Value of the object if this object is of type ExpValue.
private  int _intValue
          Value of the object if this object is of type int.
private  int _valueType
          Specifies what type of value this object holds: INT or EEE.
static int EEE
          Value representing that this object has an ExpValue value type.
static int INT
          Value representing that this object has an int value type.
 
Constructor Summary
ScaledInteger(int type)
          Constructs a Scaled Integer Object with the specified type.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this object.
 boolean equals(ScaledInteger cmp)
          Returns true if the passed-in ScaledInteger is equal or a match to this one doing a compare on the value of this object.
 boolean existsWithin(EdifNumber cmp)
          Compares to see if this Object equals or matches one of the ScaledInteger Objects in the passed in ArrayList (EdifNumber).
 void setValue(ExpValue value)
          Sets the value of this object (ExpValue type).
 void setValue(int value)
          Sets the value of this object (int type).
 void toEdif(EdifPrintWriter epw)
          Writes this object in EDIF format to the passed in EdifPrintWriter.
 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

INT

public static final int INT
Value representing that this object has an int value type.

See Also:
Constant Field Values

EEE

public static final int EEE
Value representing that this object has an ExpValue value type.

See Also:
Constant Field Values

_intValue

private int _intValue
Value of the object if this object is of type int.


_expValue

private ExpValue _expValue
Value of the object if this object is of type ExpValue.


_valueType

private int _valueType
Specifies what type of value this object holds: INT or EEE.

Constructor Detail

ScaledInteger

public ScaledInteger(int type)
Constructs a Scaled Integer Object with the specified type. The allowed types are: INT EEE

Parameters:
type - The type of this Scaled Integer Object
Method Detail

clone

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

Overrides:
clone in class java.lang.Object
Returns:
An Object, that is a clone of this Object

equals

public boolean equals(ScaledInteger cmp)
Returns true if the passed-in ScaledInteger is equal or a match to this one doing a compare on the value of this object.

Parameters:
cmp - The ScaledInteger Object to compare this Object to
Returns:
True if the two Objects have the same value

existsWithin

public boolean existsWithin(EdifNumber cmp)
Compares to see if this Object equals or matches one of the ScaledInteger Objects in the passed in ArrayList (EdifNumber).

Parameters:
cmp - The EdifNumber/ArrayList that contains a Collection of ScaledInteger Objects to compare this one to
Returns:
True if this object matches one of the Objects in the passed in array

setValue

public void setValue(int value)
Sets the value of this object (int type).

Parameters:
value - The new value of this object

setValue

public void setValue(ExpValue value)
Sets the value of this object (ExpValue type).

Parameters:
value - The ExpValue, or exponent value to set this object to.

toEdif

public void toEdif(EdifPrintWriter epw)
Writes this object in EDIF format to the passed in EdifPrintWriter.

Specified by:
toEdif in interface EdifOut
Parameters:
epw - The EdifPrintWriter object that will be written to

toString

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

Overrides:
toString in class java.lang.Object
Returns:
String representation of this object