edu.cmu.sei.aadl.model.properties
Class PropertyUtils

java.lang.Object
  extended by edu.cmu.sei.aadl.model.properties.PropertyUtils

public class PropertyUtils
extends java.lang.Object

This class contains static methods for assisting in getting simple property values of specific types. These methods are convenient, but they can mask errors in the specification being analyzed because they cannot distinguish between a property value being not present and a property value begin modal or list-valued.

Author:
aarong

Method Summary
static EnumValue createEnumValue(EnumLiteral enumValue)
          Creates a PropertyValue for an enumeration.
static IntegerRangeValue createIntegerRangeValue(long min, long max)
          Creates a PropertyValue for a range of aadlinteger.
static IntegerRangeValue createIntegerRangeValue(long min, long max, long delta)
          Creates a PropertyValue for a range of aadlinteger.
static IntegerRangeValue createIntegerRangeValue(long min, UnitLiteral minUnits, long max, UnitLiteral maxUnits)
          Creates a PropertyValue for a range of aadlinteger with units.
static IntegerRangeValue createIntegerRangeValue(long min, UnitLiteral minUnits, long max, UnitLiteral maxUnits, long delta, UnitLiteral deltaUnits)
          Creates a PropertyValue for a range of aadlinteger with units.
static IntegerValue createIntegerValue(long intValue)
          Creates a PropertyValue for an aadlinteger.
static IntegerValue createIntegerValue(long intValue, UnitLiteral unit)
          Creates a PropertyValue for an aadlinteger with units.
static RealRangeValue createRealRangeValue(double min, double max)
          Creates a PropertyValue for a range of aadlreal.
static RealRangeValue createRealRangeValue(double min, double max, double delta)
          Creates a PropertyValue for a range of aadlreal.
static RealRangeValue createRealRangeValue(double min, UnitLiteral minUnits, double max, UnitLiteral maxUnits)
          Creates a PropertyValue for a range of aadlreal with units.
static RealRangeValue createRealRangeValue(double min, UnitLiteral minUnits, double max, UnitLiteral maxUnits, double delta, UnitLiteral deltaUnits)
          Creates a PropertyValue for a range of aadlreal with units.
static RealValue createRealValue(double realValue)
          Creates a PropertyValue for an aadlreal.
static RealValue createRealValue(double realValue, UnitLiteral unit)
          Creates a PropertyValue for an aadlreal with units.
static StringValue createStringValue(java.lang.String stringValue)
          Creates a PropertyValue for a string.
static TrueFalseValue createTrueFalseValue(boolean boolValue)
          Creates a PropertyValue for an aadlboolean.
static UnitLiteral findUnitLiteral(PropertyDefinition pd, java.lang.String literalname)
          Retrieve the unit literal given a unit string for a property It is useful when calling getScaledValue methods that require the literal as object
static boolean getBooleanValue(PropertyHolder ph, PropertyDefinition pd)
          Get a non-modal boolean property value.
static boolean getBooleanValue(PropertyHolder ph, PropertyDefinition pd, boolean defaultVal)
          Get a non-modal boolean property value.
static EnumLiteral getEnumLiteral(PropertyHolder ph, PropertyDefinition pd)
          Get a non-modal enumeration property value.
static InstanceObject getInstanceObjectReference(InstanceObject io, PropertyDefinition pd)
          Get an InstanceObject from an instance reference value.
static long getIntegerValue(PropertyHolder ph, PropertyDefinition pd)
          Get a non-modal integer property value with no units.
static long getIntegerValue(PropertyHolder ph, PropertyDefinition pd, long defaultVal)
          Get a non-modal integer property value with no units.
static double getRealValue(PropertyHolder ph, PropertyDefinition pd)
          Get a non-modal real property with no units Throws an exception if no property value exists or an error occurs.
static double getRealValue(PropertyHolder ph, PropertyDefinition pd, double defaultVal)
          Get a non-modal real property value with no units.
static double getScaledNumberValue(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit)
          Get a non-modal numeric property value scaled to the given unit.
static double getScaledNumberValue(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit, double defaultVal)
          Get a non-modal numeric property value scaled to the given unit.
static double getScaledRangeDelta(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit)
          Return the delta value of a non-modal range property value scaled to a given unit.
static double getScaledRangeDelta(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit, double defaultVal)
          Return the delta value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMaximum(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit)
          Return the maximum value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMaximum(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit, double defaultVal)
          Return the maximum value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMinimum(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit)
          Return the minimum value of a non-modal range property value scaled to a given unit.
static double getScaledRangeMinimum(PropertyHolder ph, PropertyDefinition pd, UnitLiteral unit, double defaultVal)
          Return the minimum value of a non-modal range property value scaled to a given unit.
static java.lang.String getStringValue(PropertyHolder ph, PropertyDefinition pd)
          Get a non-modal string property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getIntegerValue

public static long getIntegerValue(PropertyHolder ph,
                                   PropertyDefinition pd,
                                   long defaultVal)
Get a non-modal integer property value with no units. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
defaultVal - The value to return if the property has no value.
Returns:
The integer value of the property.

getIntegerValue

public static long getIntegerValue(PropertyHolder ph,
                                   PropertyDefinition pd)
                            throws InvalidModelException,
                                   PropertyNotPresentException,
                                   PropertyIsModalException,
                                   java.lang.IllegalStateException,
                                   java.lang.IllegalArgumentException,
                                   PropertyDoesNotApplyToHolderException,
                                   PropertyIsListException,
                                   java.lang.ClassCastException
Get a non-modal integer property value with no units. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The integer value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not an integer value.

getRealValue

public static double getRealValue(PropertyHolder ph,
                                  PropertyDefinition pd,
                                  double defaultVal)
Get a non-modal real property value with no units. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
defaultVal - The value to return if the property has no value.
Returns:
The real value of the property.

getRealValue

public static double getRealValue(PropertyHolder ph,
                                  PropertyDefinition pd)
                           throws InvalidModelException,
                                  PropertyNotPresentException,
                                  PropertyIsModalException,
                                  java.lang.IllegalStateException,
                                  java.lang.IllegalArgumentException,
                                  PropertyDoesNotApplyToHolderException,
                                  PropertyIsListException,
                                  java.lang.ClassCastException
Get a non-modal real property with no units Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The real value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a real value.

getStringValue

public static java.lang.String getStringValue(PropertyHolder ph,
                                              PropertyDefinition pd)
                                       throws InvalidModelException,
                                              PropertyNotPresentException,
                                              PropertyIsModalException,
                                              java.lang.IllegalStateException,
                                              java.lang.IllegalArgumentException,
                                              PropertyDoesNotApplyToHolderException,
                                              PropertyIsListException,
                                              java.lang.ClassCastException
Get a non-modal string property value. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The string value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a string value.

getBooleanValue

public static boolean getBooleanValue(PropertyHolder ph,
                                      PropertyDefinition pd,
                                      boolean defaultVal)
Get a non-modal boolean property value. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
defaultVal - The value to return if the property has no value.
Returns:
The boolean value of the property.

getBooleanValue

public static boolean getBooleanValue(PropertyHolder ph,
                                      PropertyDefinition pd)
                               throws InvalidModelException,
                                      PropertyNotPresentException,
                                      PropertyIsModalException,
                                      java.lang.IllegalStateException,
                                      java.lang.IllegalArgumentException,
                                      PropertyDoesNotApplyToHolderException,
                                      PropertyIsListException,
                                      java.lang.ClassCastException
Get a non-modal boolean property value. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The boolean value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a TrueFalseValue value.

getEnumLiteral

public static EnumLiteral getEnumLiteral(PropertyHolder ph,
                                         PropertyDefinition pd)
                                  throws InvalidModelException,
                                         PropertyNotPresentException,
                                         PropertyIsModalException,
                                         java.lang.IllegalStateException,
                                         java.lang.IllegalArgumentException,
                                         PropertyDoesNotApplyToHolderException,
                                         PropertyIsListException,
                                         java.lang.ClassCastException
Get a non-modal enumeration property value. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
Returns:
The enumeration literal of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if ph or pd is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not an enumeration value.

getScaledNumberValue

public static double getScaledNumberValue(PropertyHolder ph,
                                          PropertyDefinition pd,
                                          UnitLiteral unit,
                                          double defaultVal)
Get a non-modal numeric property value scaled to the given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The scaled property value of the property.

getScaledNumberValue

public static double getScaledNumberValue(PropertyHolder ph,
                                          PropertyDefinition pd,
                                          UnitLiteral unit)
                                   throws InvalidModelException,
                                          PropertyNotPresentException,
                                          PropertyIsModalException,
                                          java.lang.IllegalStateException,
                                          java.lang.IllegalArgumentException,
                                          PropertyDoesNotApplyToHolderException,
                                          PropertyIsListException,
                                          java.lang.ClassCastException
Get a non-modal numeric property value scaled to the given unit. Throws an exception is no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The scaled property value of the property.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a number value.

getScaledRangeMaximum

public static double getScaledRangeMaximum(PropertyHolder ph,
                                           PropertyDefinition pd,
                                           UnitLiteral unit,
                                           double defaultVal)
Return the maximum value of a non-modal range property value scaled to a given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The maximum of the range value scaled to the given unit.

getScaledRangeMaximum

public static double getScaledRangeMaximum(PropertyHolder ph,
                                           PropertyDefinition pd,
                                           UnitLiteral unit)
                                    throws InvalidModelException,
                                           PropertyNotPresentException,
                                           PropertyIsModalException,
                                           java.lang.IllegalStateException,
                                           java.lang.IllegalArgumentException,
                                           PropertyDoesNotApplyToHolderException,
                                           PropertyIsListException,
                                           java.lang.ClassCastException
Return the maximum value of a non-modal range property value scaled to a given unit. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The maximum of the range value scaled to the given unit.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a range value.

getScaledRangeMinimum

public static double getScaledRangeMinimum(PropertyHolder ph,
                                           PropertyDefinition pd,
                                           UnitLiteral unit,
                                           double defaultVal)
Return the minimum value of a non-modal range property value scaled to a given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The minimum of the range value scaled to the given unit.

getScaledRangeMinimum

public static double getScaledRangeMinimum(PropertyHolder ph,
                                           PropertyDefinition pd,
                                           UnitLiteral unit)
                                    throws InvalidModelException,
                                           PropertyNotPresentException,
                                           PropertyIsModalException,
                                           java.lang.IllegalStateException,
                                           java.lang.IllegalArgumentException,
                                           PropertyDoesNotApplyToHolderException,
                                           PropertyIsListException,
                                           java.lang.ClassCastException
Return the minimum value of a non-modal range property value scaled to a given unit. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The minimum of the range value scaled to the given unit.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a range value.

getScaledRangeDelta

public static double getScaledRangeDelta(PropertyHolder ph,
                                         PropertyDefinition pd,
                                         UnitLiteral unit,
                                         double defaultVal)
Return the delta value of a non-modal range property value scaled to a given unit. Returns a given default value if no property value exists. Throws an exception if an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
defaultVal - The value to return if the property has no value.
Returns:
The delta of the range value scaled to the given unit.

getScaledRangeDelta

public static double getScaledRangeDelta(PropertyHolder ph,
                                         PropertyDefinition pd,
                                         UnitLiteral unit)
                                  throws InvalidModelException,
                                         PropertyNotPresentException,
                                         PropertyIsModalException,
                                         java.lang.IllegalStateException,
                                         java.lang.IllegalArgumentException,
                                         PropertyDoesNotApplyToHolderException,
                                         PropertyIsListException,
                                         java.lang.ClassCastException
Return the delta value of a non-modal range property value scaled to a given unit. Throws an exception if no property value exists or an error occurs.

Parameters:
ph - The property holder from which to retrieve the property value.
pd - The property to retrieve.
unit - The unit to scale the value to.
Returns:
The delta of the range value scaled to the given unit.
Throws:
InvalidModelException - Thrown if the property value cannot be retrieved because the model is incomplete or otherwise invalid.
PropertyNotPresentException - Thrown if the property is undefined for ph.
PropertyIsModalException - Thrown if ph is modal and declarative.
java.lang.IllegalStateException - Thrown if the lookup encounters a cycle of property reference dependencies.
java.lang.IllegalArgumentException - Thrown if the given unit literal is not from the property's unit type or if ph, pd, or unit is null.
PropertyDoesNotApplyToHolderException - Thrown if pd does not apply to ph.
PropertyIsListException - Thrown if the property is not scalar.
java.lang.ClassCastException - Thrown if the retrieved value is not a range value.

getInstanceObjectReference

public static InstanceObject getInstanceObjectReference(InstanceObject io,
                                                        PropertyDefinition pd)
Get an InstanceObject from an instance reference value. Throws an exception if no property value exists or an error occurs.

Parameters:
io - The instance objet from which to retrieve the property value. (We don't use a property holder because we can only get an instance reference value as a property value from an instance object.)
pd - The property to retrieve.
Returns:
The instance object of the property.

createIntegerValue

public static IntegerValue createIntegerValue(long intValue)
Creates a PropertyValue for an aadlinteger.


createIntegerValue

public static IntegerValue createIntegerValue(long intValue,
                                              UnitLiteral unit)
                                       throws java.lang.IllegalArgumentException
Creates a PropertyValue for an aadlinteger with units.

Throws:
java.lang.IllegalArgumentException - Thrown if unit is null.

createIntegerRangeValue

public static IntegerRangeValue createIntegerRangeValue(long min,
                                                        long max)
                                                 throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createIntegerRangeValue

public static IntegerRangeValue createIntegerRangeValue(long min,
                                                        UnitLiteral minUnits,
                                                        long max,
                                                        UnitLiteral maxUnits)
                                                 throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits or maxUnits is null, if minUnits and maxUnits are not of the same UnitType, or if min is greater than max.

createIntegerRangeValue

public static IntegerRangeValue createIntegerRangeValue(long min,
                                                        long max,
                                                        long delta)
                                                 throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createIntegerRangeValue

public static IntegerRangeValue createIntegerRangeValue(long min,
                                                        UnitLiteral minUnits,
                                                        long max,
                                                        UnitLiteral maxUnits,
                                                        long delta,
                                                        UnitLiteral deltaUnits)
                                                 throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlinteger with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits, maxUnits, or deltaUnits is null, if minUnits, maxUnits, and deltaUnits are not of the same UnitType, or if min is greater than max.

createRealValue

public static RealValue createRealValue(double realValue)
Creates a PropertyValue for an aadlreal.


createRealValue

public static RealValue createRealValue(double realValue,
                                        UnitLiteral unit)
                                 throws java.lang.IllegalArgumentException
Creates a PropertyValue for an aadlreal with units.

Throws:
java.lang.IllegalArgumentException - Thrown if unit is null.

createRealRangeValue

public static RealRangeValue createRealRangeValue(double min,
                                                  double max)
                                           throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createRealRangeValue

public static RealRangeValue createRealRangeValue(double min,
                                                  UnitLiteral minUnits,
                                                  double max,
                                                  UnitLiteral maxUnits)
                                           throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits or maxUnits is null, if minUnits and maxUnits are not of the same UnitType, or if min is greater than max.

createRealRangeValue

public static RealRangeValue createRealRangeValue(double min,
                                                  double max,
                                                  double delta)
                                           throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal.

Throws:
java.lang.IllegalArgumentException - Thrown if min is greater than max.

createRealRangeValue

public static RealRangeValue createRealRangeValue(double min,
                                                  UnitLiteral minUnits,
                                                  double max,
                                                  UnitLiteral maxUnits,
                                                  double delta,
                                                  UnitLiteral deltaUnits)
                                           throws java.lang.IllegalArgumentException
Creates a PropertyValue for a range of aadlreal with units.

Throws:
java.lang.IllegalArgumentException - Thrown if minUnits, maxUnits, or deltaUnits is null, if minUnits, maxUnits, and deltaUnits are not of the same UnitType, or if min is greater than max.

createStringValue

public static StringValue createStringValue(java.lang.String stringValue)
                                     throws java.lang.IllegalArgumentException
Creates a PropertyValue for a string.

Throws:
java.lang.IllegalArgumentException - Thrown if stringValue is null.

createTrueFalseValue

public static TrueFalseValue createTrueFalseValue(boolean boolValue)
Creates a PropertyValue for an aadlboolean.


createEnumValue

public static EnumValue createEnumValue(EnumLiteral enumValue)
                                 throws java.lang.IllegalArgumentException
Creates a PropertyValue for an enumeration.

Throws:
java.lang.IllegalArgumentException - Thrown if enumValue is null.

findUnitLiteral

public static UnitLiteral findUnitLiteral(PropertyDefinition pd,
                                          java.lang.String literalname)
Retrieve the unit literal given a unit string for a property It is useful when calling getScaledValue methods that require the literal as object

Parameters:
pd - Property Definition
literalname - String
Returns:
UnitLiteral or null if the unit literal could not be found or the definition does not have a unit