Example #1
0
        }         // GetHashCode

        public virtual int CompareTo(AIntervalEdge <TFinite> other)
        {
            if (other == null)
            {
                throw new ArgumentNullException();
            }

            if (Type == other.Type)
            {
                return(Type == EdgeType.Finite ? Value.CompareTo(other.Value) : 0);
            }

            switch (Type)
            {
            case EdgeType.NegativeInfinity:
                return(-1);

            case EdgeType.Finite:
                return(other.Type == EdgeType.NegativeInfinity ? 1 : -1);

            case EdgeType.PositiveInfinity:
                return(1);

            default:
                throw new ArgumentOutOfRangeException();
            }     // switch
        }         // CompareTo
Example #2
0
        }         // Min

        public virtual AIntervalEdge <TFinite> Max(AIntervalEdge <TFinite> other)
        {
            if (ReferenceEquals(other, null))
            {
                throw new ArgumentNullException();
            }

            return(this > other ? this : other);
        }         // Max
Example #3
0
        public TInterval(AIntervalEdge <TFinite> oLeft, AIntervalEdge <TFinite> oRight)
        {
            if (ReferenceEquals(oLeft, null) || ReferenceEquals(oRight, null))
            {
                throw new ArgumentNullException();
            }

            Left  = oLeft;
            Right = oRight;
        }         // constructor
        }         // IsValueEqualTo

        protected override bool IsValueLessThan(AIntervalEdge <decimal> other)
        {
            return(IsValueLessThan(other.Value));
        }         // IsValueLessThan
 protected override bool IsValueEqualTo(AIntervalEdge <decimal> other)
 {
     return(IsValueEqualTo(other.Value));
 }         // IsValueEqualTo
Example #6
0
        }         // Intersects

        public virtual bool Contains(AIntervalEdge <TFinite> p)
        {
            return((Left <= p) && (p <= Right));
        }         // Contains
Example #7
0
        }         // IsValueEqualTo

        protected override bool IsValueLessThan(AIntervalEdge <int> other)
        {
            return(Value < other.Value);
        }         // IsValueLessThan
Example #8
0
        }         // Next

        protected override bool IsValueEqualTo(AIntervalEdge <int> other)
        {
            return(Value == other.Value);
        }         // IsValueEqualTo
Example #9
0
        }         // constructor

        protected DateInterval(AIntervalEdge <DateTime> oLeft, AIntervalEdge <DateTime> oRight) : base(oLeft, oRight)
        {
        }         // constructor
Example #10
0
 protected abstract bool IsValueLessThan(AIntervalEdge <TFinite> other);
Example #11
0
        }         // constructor

        protected abstract bool IsValueEqualTo(AIntervalEdge <TFinite> other);