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)); }
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)); }
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); }
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); }