Struct DoseValue
Represents a dose value. DoseValue semantics follows the semantics of System.Double, with DoseValue.Undefined corresponding to Double.NaN.
Implements
Inherited Members
Namespace: VMS.TPS.Common.Model.Types
Assembly: VMS.TPS.Common.Model.Types.dll
Syntax
public struct DoseValue : IXmlSerializable, IComparable<DoseValue>, IEquatable<DoseValue>
Constructors
DoseValue(Double, String)
Constructs a DoseValue.
Declaration
public DoseValue(double value, string unitName)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value for this instance. |
System.String | unitName | String that corresponds to one of the enumeration values of DoseUnit. |
DoseValue(Double, DoseValue.DoseUnit)
Constructs a DoseValue.
Declaration
public DoseValue(double value, DoseValue.DoseUnit unit)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | Value for this instance |
DoseValue.DoseUnit | unit | Unit of this instance. |
Fields
Undefined
A dose value, for which the value is Double.NaN and
the unit is unknown.
Declaration
public static readonly DoseValue Undefined
Field Value
Type | Description |
---|---|
DoseValue |
Properties
Decimals
The display precision of this value
Declaration
public int Decimals { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Dose
The value of this instance.
Declaration
public double Dose { get; }
Property Value
Type | Description |
---|---|
System.Double |
IsAbsoluteDoseValue
Returns true if the unit of the dose value is absolute (Gy or cGy).
Declaration
public bool IsAbsoluteDoseValue { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsRelativeDoseValue
Returns true if the unit of the dose value is relative (%).
Declaration
public bool IsRelativeDoseValue { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Unit
The unit of this instance.
Declaration
public DoseValue.DoseUnit Unit { get; }
Property Value
Type | Description |
---|---|
DoseValue.DoseUnit |
UnitAsString
The unit of this instance as a string.
Declaration
public string UnitAsString { get; }
Property Value
Type | Description |
---|---|
System.String |
ValueAsString
The value of this instance as a string.
Declaration
public string ValueAsString { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
CompareTo(DoseValue)
Comparison of dose values. DoseValue.Undefined preceeds other values. Otherwise, different units cause an exception to be thrown. The values are compared using Double.CompareTo(Double).
Declaration
public int CompareTo(DoseValue other)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | other | Dose value to compare this to. |
Returns
Type | Description |
---|---|
System.Int32 | Comparison result. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |
Equals(Object)
Equality comparison of DoseValue and Object. This method considers two instances of DoseValue.Undefined to be equal to each other. Otherwise, a dose value is equal to an object only if the object is a DoseValue and the units and the values are equal. For epsilon-equal comparison, use Equals(DoseValue, Double).
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | Object to compare this to. |
Returns
Type | Description |
---|---|
System.Boolean | True if the Object is also DoseValue and equal to this (value and unit), false otherwise. |
Overrides
Equals(DoseValue)
Equality comparison of dose values. This method considers two instances of DoseValue.Undefined to be equal to each other. Otherwise, two dose values are equal only if the units and the values are equal. For epsilon-equal comparison, use Equals(DoseValue, Double).
Declaration
public bool Equals(DoseValue other)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | other | Dose value to compare this to. |
Returns
Type | Description |
---|---|
System.Boolean | True if the units and values are equal, false otherwise. |
Equals(DoseValue, Double)
Epsilon-equality comparison of dose values. This method considers two instances of DoseValue.Undefined to be equal to each other. Otherwise, two dose values are equal only if the units are equal and the values are within epsilon.
Declaration
public bool Equals(DoseValue other, double epsilon)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | other | Dose value to compare this to. |
System.Double | epsilon | Epsilon to use for the dose value comparison. |
Returns
Type | Description |
---|---|
System.Boolean | True if the units are equal and values are within epsilon, false otherwise. |
GetHashCode()
A hash code for the current object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current object. |
Overrides
GetSchema()
This member is internal to the Eclipse Scripting API.
Declaration
public XmlSchema GetSchema()
Returns
Type | Description |
---|---|
System.Xml.Schema.XmlSchema | XmlSchema. |
IsAbsoluteDoseUnit(DoseValue.DoseUnit)
Returns true if the dose unit is absolute (Gy or cGy).
Declaration
public static bool IsAbsoluteDoseUnit(DoseValue.DoseUnit doseUnit)
Parameters
Type | Name | Description |
---|---|---|
DoseValue.DoseUnit | doseUnit | The dose unit that is evaluated. |
Returns
Type | Description |
---|---|
System.Boolean | True if the dose unit is absolute (Gy or cGy). Otherwise returns false. |
IsRelativeDoseUnit(DoseValue.DoseUnit)
Returns true if the dose unit is relative (%).
Declaration
public static bool IsRelativeDoseUnit(DoseValue.DoseUnit doseUnit)
Parameters
Type | Name | Description |
---|---|---|
DoseValue.DoseUnit | doseUnit | The dose unit that is evaluated. |
Returns
Type | Description |
---|---|
System.Boolean | True if the dose unit is relative (%). Otherwise returns false. |
IsUndefined()
Returns true if this dose value is equal to DoseValue.Undefined, false otherwise.
Declaration
public bool IsUndefined()
Returns
Type | Description |
---|---|
System.Boolean | True if this dose value is not defined, false otherwise. |
ReadXml(XmlReader)
This member is internal to the Eclipse Scripting API.
Declaration
public void ReadXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | XmlReader. |
ToString()
A string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A string that represents the current object. |
Overrides
UndefinedDose()
A dose value, for which the value is Double.NaN and
the unit is unknown.
Declaration
public static DoseValue UndefinedDose()
Returns
Type | Description |
---|---|
DoseValue | Undefined dose value. |
WriteXml(XmlWriter)
Serialization support.
Declaration
public void WriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | The System.Xml.XmlWriter stream to which the object is serialized. |
Operators
Addition(DoseValue, DoseValue)
Addition of dose values. If either of the operands is DoseValue.Undefined, the result will be DoseValue.Undefined.
Declaration
public static DoseValue operator +(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
DoseValue | Result of addition. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |
Division(DoseValue, Double)
Division of a dose value by a double. If the dose value is DoseValue.Undefined, the result will be DoseValue.Undefined.
Declaration
public static DoseValue operator /(DoseValue dv, double dbl)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv | Dividend. |
System.Double | dbl | Divisor. |
Returns
Type | Description |
---|---|
DoseValue | Result of division. |
Division(DoseValue, DoseValue)
Division of two dose values. If either of the operands is DoseValue.Undefined, the result will be Double.NaN.
Declaration
public static double operator /(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | Dividend. |
DoseValue | dv2 | Divisor. |
Returns
Type | Description |
---|---|
System.Double | Result of division. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |
Equality(DoseValue, DoseValue)
Equality operator for dose values. This operator considers two instances of DoseValue.Undefined to be inequal. For epsilon-equal comparison, use Equals(DoseValue, Double).
Declaration
public static bool operator ==(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
System.Boolean | True if the units and values are equal, false otherwise. |
GreaterThan(DoseValue, DoseValue)
Greater-than comparison of dose values. Comparison with DoseValue.Undefined is false.
Declaration
public static bool operator>(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
System.Boolean | Comparison result. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |
GreaterThanOrEqual(DoseValue, DoseValue)
Greater-than comparison of dose values. Comparison with DoseValue.Undefined is false.
Declaration
public static bool operator >=(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
System.Boolean | Comparison result. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |
Inequality(DoseValue, DoseValue)
Inequality operator for dose values. This operator considers two instances of DoseValue.Undefined to be inequal. For epsilon-equal comparison, use Equals(DoseValue, Double).
Declaration
public static bool operator !=(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
System.Boolean | True if the units, values, or both of them are inequal, false otherwise. |
LessThan(DoseValue, DoseValue)
Less-than comparison of dose values. Comparison with DoseValue.Undefined is false.
Declaration
public static bool operator <(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
System.Boolean | Comparison result. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |
LessThanOrEqual(DoseValue, DoseValue)
Less-than-or-equal comparison of dose values. Comparison with DoseValue.Undefined is false.
Declaration
public static bool operator <=(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
System.Boolean | Comparison result. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |
Multiply(Double, DoseValue)
Multiplication of a dose value and a double. If the dose value is DoseValue.Undefined, the result will be DoseValue.Undefined.
Declaration
public static DoseValue operator *(double dbl, DoseValue dv)
Parameters
Type | Name | Description |
---|---|---|
System.Double | dbl | Multiplier. |
DoseValue | dv | DoseValue to multiply. |
Returns
Type | Description |
---|---|
DoseValue | Result of multiplication. |
Multiply(DoseValue, Double)
Multiplication of a dose value and a double. If the dose value is DoseValue.Undefined, the result will be DoseValue.Undefined.
Declaration
public static DoseValue operator *(DoseValue dv, double dbl)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv | DoseValue to multiply. |
System.Double | dbl | Multiplier. |
Returns
Type | Description |
---|---|
DoseValue | Result of multiplication. |
Subtraction(DoseValue, DoseValue)
Subtraction of dose values. If either of the operands is DoseValue.Undefined, the result will be DoseValue.Undefined.
Declaration
public static DoseValue operator -(DoseValue dv1, DoseValue dv2)
Parameters
Type | Name | Description |
---|---|---|
DoseValue | dv1 | First operand. |
DoseValue | dv2 | Second operand. |
Returns
Type | Description |
---|---|
DoseValue | Subtraction result. |
Exceptions
Type | Condition |
---|---|
System.ArithmeticException | Thrown if units are different. |