Exemple #1
0
        /// <summary>
        /// Determine if this RTO equals another
        /// </summary>
        public override BL SemanticEquals(IAny other)
        {
            var baseEq = base.SemanticEquals(other);

            if (!(bool)baseEq)
            {
                return(baseEq);
            }

            // Null-flavored
            if (this.IsNull && other.IsNull)
            {
                return(true);
            }
            else if (this.IsNull ^ other.IsNull)
            {
                return(false);
            }

            // Values are equal?
            RTO <S, T> rtoOther = other as RTO <S, T>;

            if (rtoOther == null)
            {
                return(false);
            }
            else if (rtoOther.Numerator != null && rtoOther.Denominator != null && this.Numerator != null && this.Denominator != null)
            {
                return(rtoOther.Numerator.SemanticEquals(this.Numerator) & rtoOther.Denominator.SemanticEquals(this.Denominator));
            }
            return(false);
        }
Exemple #2
0
        // <summary>
        // Parse a generic RTO from a serialization surrogate RTO
        // </summary>
        //public static RTO<S, T> FromSurrogate(Surrogates.RTO o)
        //{
        //    RTO<S, T> retVal = new RTO<S, T>();
        //    retVal.Denominator = (T)Util.FromWireFormat(o, typeof(T));
        //    retVal.Numerator = (S)Util.FromWireFormat(o, typeof(S));
        //    retVal.ControlActExt = o.ControlActExt;
        //    retVal.ControlActRoot = o.ControlActRoot;
        //    retVal.Expression = o.Expression.Clone() as ED;
        //    retVal.ExpressionLanguage = o.ExpressionLanguage;
        //    retVal.Flavor = o.Flavor;
        //    retVal.NullFlavor = o.NullFlavor.Clone() as CS<NullFlavor>;
        //    retVal.OriginalText = o.OriginalText.Clone() as ED;
        //    retVal.Uncertainty = o.Uncertainty;
        //    retVal.UncertaintyType = o.UncertaintyType;
        //    retVal.UpdateMode = o.UpdateMode.Clone() as CS<UpdateMode>;
        //    retVal.ValidTimeHigh = o.ValidTimeHigh;
        //    retVal.ValidTimeLow = o.ValidTimeLow;
        //    retVal.Value = retVal.Value;
        //    return retVal;
        //}


        #region IEquatable<RTO<S,T>> Members

        /// <summary>
        /// Determine if RTO of S/T is the same as another RTO of S/T
        /// </summary>
        public bool Equals(RTO <S, T> other)
        {
            bool result = false;

            if (other != null)
            {
                result = (base.Equals((PDV <Double?>)other) &&
                          (other.Expression != null ? other.Expression.Equals(this.Expression) : this.Expression == null) &&
                          (other.OriginalText != null ? other.OriginalText.Equals(this.OriginalText) : this.OriginalText == null) &&
                          (other.Uncertainty != null ? other.Uncertainty.Equals(this.Uncertainty) : this.Uncertainty == null) &&
                          other.UncertaintyType == this.UncertaintyType) &&
                         (other.Denominator != null ? other.Denominator.Equals(this.Denominator) : this.Denominator == null) &&
                         (other.Numerator != null ? other.Numerator.Equals(this.Numerator) : this.Numerator == null) ||
                         (base.Equals((ANY)other) &&
                          this.Numerator == null && other.Numerator == null &&
                          this.Denominator == null && other.Denominator == null &&
                          (other.UncertainRange != null ? other.UncertainRange.Equals(this.UncertainRange) : this.UncertainRange == null));
            }
            return(result);
        }
Exemple #3
0
 /// <summary>
 /// Create a new instance of the PIVL type using the phase and period specified
 /// </summary>
 /// <param name="phase">The phase of the PIVL</param>
 /// <param name="frequency">The period of the PIVL</param>
 /// <param name="count">The maximum number of times the PIVL can repreat</param>
 public PIVL(IVL <T> phase, RTO <INT, PQ> frequency, INT count) : this(phase, frequency)
 {
     this.Count = count;
 }
Exemple #4
0
 /// <summary>
 /// Create a new instance of the PIVL type using the phase and period specified
 /// </summary>
 /// <param name="phase">The phase of the PIVL</param>
 /// <param name="frequency">The period of the PIVL</param>
 public PIVL(IVL <T> phase, RTO <INT, PQ> frequency)
 {
     this.Phase = phase; this.Frequency = frequency;
 }