org.opensha.commons.util
Class ParamUtils

java.lang.Object
  extended by org.opensha.commons.util.ParamUtils

public class ParamUtils
extends java.lang.Object

Title:ParamUtils

Description:Generic functions used in handling parameters, basically verifying the class type of a Parameter. Recall that all Parameters implement the ParameterAPI. Because of this they are passed around functions as ParameterAPI. In some cases you need to know more specifically the class type in order to access the special functions of these subclasses. This utility class verifies the class type so you can cast to the right type without throwing errors.

Version:
1.0
Author:
Steven W. Rock

Constructor Summary
ParamUtils()
           
 
Method Summary
static boolean isDoubleConstraint(Parameter param)
          Returns true if the ParameterAPI contained constraint is a DoubleConstraint.
static boolean isDoubleDiscreteConstraint(Parameter param)
          Returns true if the ParameterAPI contained constraint is a DoubleDiscreteConstraint.
static boolean isDoubleOrDoubleDiscreteConstraint(Parameter param)
          Returns true if the ParameterAPI is a DoubleParameter or DoubleDiscreteParameter.
static boolean isWarningParameterAPI(Parameter param)
          Returns true if the ParameterAPI is an instance of WarningParameterAPI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParamUtils

public ParamUtils()
Method Detail

isDoubleOrDoubleDiscreteConstraint

public static boolean isDoubleOrDoubleDiscreteConstraint(Parameter param)
Returns true if the ParameterAPI is a DoubleParameter or DoubleDiscreteParameter. This allows you to get and set the value as a Double.

Parameters:
The - parameter to verify
Returns:
boolean true if is either parameter type, else false

isDoubleConstraint

public static boolean isDoubleConstraint(Parameter param)
Returns true if the ParameterAPI contained constraint is a DoubleConstraint.

Parameters:
The - parameter to verify
Returns:
boolean true if constraint is DOubleConstraint, false otherwise.

isDoubleDiscreteConstraint

public static boolean isDoubleDiscreteConstraint(Parameter param)
Returns true if the ParameterAPI contained constraint is a DoubleDiscreteConstraint.

Parameters:
The - parameter to verify
Returns:
boolean if is either parameter type

isWarningParameterAPI

public static boolean isWarningParameterAPI(Parameter param)
Returns true if the ParameterAPI is an instance of WarningParameterAPI

Parameters:
The - parameter to verify
Returns:
boolean if is either parameter type