Esempio n. 1
0
        public int CompareTo(Transition <T> other)
        {
            int fromCmp   = FromState.CompareTo(other.FromState);
            int symbolCmp = Symbol.CompareTo(other.Symbol);
            int toCmp     = ToState.CompareTo(other.ToState);

            return(fromCmp != 0 ? fromCmp : (symbolCmp != 0 ? symbolCmp : toCmp));
        }
Esempio n. 2
0
        public virtual int CompareTo(Transition <T> t)
        {
            int fromCmp   = FromState.CompareTo(t.FromState);
            int symbolCmp = Symbol.CompareTo(t.Symbol);
            int toCmp     = ToState.CompareTo(t.ToState);

            return(fromCmp != 0 ? fromCmp : (symbolCmp != 0 ? symbolCmp : toCmp));
        }
Esempio n. 3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            else if (obj is Transition <T> )
            {
                Transition <T> transition = (Transition <T>)obj;
                return(FromState.CompareTo(transition.FromState) == 0 &&
                       ToState.CompareTo(transition.ToState) == 0 &&
                       Symbol == transition.Symbol);
            }

            return(false);
        }
Esempio n. 4
0
        public override bool Equals(Object other)
        {
            if (other == null)
            {
                return(false);
            }

            if (other is Transition <T> )
            {
                Transition <T> oT = (Transition <T>)other;
                return
                    (FromState.CompareTo(oT.FromState) == 0 &&
                     ToState.CompareTo(oT.ToState) == 0 &&
                     Symbol == oT.Symbol);
            }

            return(false);
        }