com.jp.comp.calculator
Class CalculatorEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bycom.jp.comp.calculator.CalculatorEvent
All Implemented Interfaces:
java.io.Serializable

public class CalculatorEvent
extends java.util.EventObject

CalculatorEvent is an event which indicates that either calculation result or number of fraction digits change is occurred

See Also:
CalculatorListener, Serialized Form

Field Summary
protected  boolean fFinalResult
           
protected  int fFractionDigits
           
protected  double fResult
           
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
CalculatorEvent(java.lang.Object aSource)
          Constructs a new CalculatorEvent
CalculatorEvent(java.lang.Object aSource, double aResult)
          Constructs a new CalculatorEvent
CalculatorEvent(java.lang.Object aSource, double aResult, boolean aFinalResult)
          Constructs a new CalculatorEvent
CalculatorEvent(java.lang.Object aSource, double aResult, boolean aFinalResult, int aFractionDigits)
          Constructs a new CalculatorEvent
CalculatorEvent(java.lang.Object aSource, int aFractionDigits)
          Constructs a new CalculatorEvent
 
Method Summary
 int getFractionDigits()
          Returns the number of fraction digits
 double getResult()
          Returns the calculation result.
 boolean isFinalResult()
          Returns true if the result is final and false if intermediate
 void setFinalResult(boolean aFinalResult)
          Sets true if the result is final and false if intermediate
 void setFractionDigits(int aFractionDigits)
          Sets the number of fraction digits
 void setResult(double aResult)
          Sets the calculation result value
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fResult

protected double fResult

fFractionDigits

protected int fFractionDigits

fFinalResult

protected boolean fFinalResult
Constructor Detail

CalculatorEvent

public CalculatorEvent(java.lang.Object aSource)
Constructs a new CalculatorEvent

Parameters:
aSource - the source of the event

CalculatorEvent

public CalculatorEvent(java.lang.Object aSource,
                       double aResult)
Constructs a new CalculatorEvent

Parameters:
aSource - the source of the event
aResult - the calculation result value

CalculatorEvent

public CalculatorEvent(java.lang.Object aSource,
                       double aResult,
                       boolean aFinalResult)
Constructs a new CalculatorEvent

Parameters:
aSource - the source of the event
aResult - the calculation result value
aFinalResult - the result flag

CalculatorEvent

public CalculatorEvent(java.lang.Object aSource,
                       int aFractionDigits)
Constructs a new CalculatorEvent

Parameters:
aSource - the source of the event
aFractionDigits - the number of fraction digits

CalculatorEvent

public CalculatorEvent(java.lang.Object aSource,
                       double aResult,
                       boolean aFinalResult,
                       int aFractionDigits)
Constructs a new CalculatorEvent

Parameters:
aSource - the source of the event
aResult - the calculation result value
aFinalResult - the result flag
aFractionDigits - the number of fraction digits
Method Detail

getResult

public double getResult()
Returns the calculation result.

Returns:
the calculation result

setResult

public void setResult(double aResult)
Sets the calculation result value

Parameters:
aResult - the calculation result value

getFractionDigits

public int getFractionDigits()
Returns the number of fraction digits

Returns:
the number of fraction digits

setFractionDigits

public void setFractionDigits(int aFractionDigits)
Sets the number of fraction digits

Parameters:
aFractionDigits - the number of fraction digits

isFinalResult

public boolean isFinalResult()
Returns true if the result is final and false if intermediate

Returns:
is the result final

setFinalResult

public void setFinalResult(boolean aFinalResult)
Sets true if the result is final and false if intermediate

Parameters:
aFinalResult - the result flag