Exemplo n.º 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
Exemplo n.º 2
0
        }         // Min

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

            return(this > other ? this : other);
        }         // Max
Exemplo n.º 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
Exemplo n.º 4
0
        }         // IsValueEqualTo

        protected override bool IsValueLessThan(AIntervalEdge <decimal> other)
        {
            return(IsValueLessThan(other.Value));
        }         // IsValueLessThan
Exemplo n.º 5
0
 protected override bool IsValueEqualTo(AIntervalEdge <decimal> other)
 {
     return(IsValueEqualTo(other.Value));
 }         // IsValueEqualTo
Exemplo n.º 6
0
        }         // Intersects

        public virtual bool Contains(AIntervalEdge <TFinite> p)
        {
            return((Left <= p) && (p <= Right));
        }         // Contains
Exemplo n.º 7
0
        }         // IsValueEqualTo

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

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

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

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