Пример #1
0
 public override bool Equals(object o)
 {
     if (this == o)
     {
         return(true);
     }
     if (!(o is Edu.Stanford.Nlp.Util.Quadruple))
     {
         return(false);
     }
     Edu.Stanford.Nlp.Util.Quadruple <T1, T2, T3, T4> quadruple = ErasureUtils.UncheckedCast(o);
     if (first != null ? !first.Equals(quadruple.first) : quadruple.first != null)
     {
         return(false);
     }
     if (second != null ? !second.Equals(quadruple.second) : quadruple.second != null)
     {
         return(false);
     }
     if (third != null ? !third.Equals(quadruple.third) : quadruple.third != null)
     {
         return(false);
     }
     if (fourth != null ? !fourth.Equals(quadruple.fourth) : quadruple.fourth != null)
     {
         return(false);
     }
     return(true);
 }
Пример #2
0
        public virtual int CompareTo(Edu.Stanford.Nlp.Util.Quadruple <T1, T2, T3, T4> another)
        {
            int comp = ((IComparable <T1>)First()).CompareTo(another.First());

            if (comp != 0)
            {
                return(comp);
            }
            else
            {
                comp = ((IComparable <T2>)Second()).CompareTo(another.Second());
                if (comp != 0)
                {
                    return(comp);
                }
                else
                {
                    comp = ((IComparable <T3>)Third()).CompareTo(another.Third());
                    if (comp != 0)
                    {
                        return(comp);
                    }
                    else
                    {
                        return(((IComparable <T4>)Fourth()).CompareTo(another.Fourth()));
                    }
                }
            }
        }