org.opensha.commons.param.event
Class ParameterChangeWarningEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.opensha.commons.param.event.ParameterChangeWarningEvent
All Implemented Interfaces:
java.io.Serializable

public class ParameterChangeWarningEvent
extends java.util.EventObject

Title: ParameterChangeWarningEvent

Description: This event is thrown when you try to modify a parameter's value beyond it's recommended value. This event gives the calling class the ability to either head the warnings or ignore it and update the parameter anyways.

Version:
1.0
Author:
Steven W. Rock
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
ParameterChangeWarningEvent(java.lang.Object reference, WarningParameter param, java.lang.Object oldValue, java.lang.Object newValue)
          Constructor for the ParameterChangeWarningEvent object.
 
Method Summary
 void commitNewChange()
          Set's the new value ignoring the warning
 java.lang.Object getNewValue()
          Gets the desired new value.
 java.lang.Object getOldValue()
          Gets the old value for the Parameter.
 WarningParameter getWarningParameter()
          Gets the name of Parameter that failed a change.
 
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
 

Constructor Detail

ParameterChangeWarningEvent

public ParameterChangeWarningEvent(java.lang.Object reference,
                                   WarningParameter param,
                                   java.lang.Object oldValue,
                                   java.lang.Object newValue)
Constructor for the ParameterChangeWarningEvent object.

Parameters:
reference - Object which created this event, i.e. the parametr
parameterName - Name of Parameter tried to change.
oldValue - Old value for the Parameter
badValue - New value for the Parameter that failed
Method Detail

getWarningParameter

public WarningParameter getWarningParameter()
Gets the name of Parameter that failed a change.

Returns:
Name of Parameter tried to change

getNewValue

public java.lang.Object getNewValue()
Gets the desired new value.

Returns:
new value for the Parameter

getOldValue

public java.lang.Object getOldValue()
Gets the old value for the Parameter.

Returns:
Old value for the Parameter

commitNewChange

public void commitNewChange()
Set's the new value ignoring the warning