1 /// <summary>2 ///decision A greater than B (A.compareto (b) <0)3 /// </summary>4 /// <typeparam name= "T" >any object that implements the IComparable interface</typeparam>5 /// <param name= "a" >Compare Object A</param>6 /// <param name= "B" >Compare object B</param>7 /// <returns></returns>8 Private Static BOOLA_gt_b<t> (t A, T B)wheret:icomparable9 {Ten returnA.compareto (b) >0; One } A - /// <summary> - ///decision A greater than or equal to B (A.compareto (B) <=0) the /// </summary> - /// <typeparam name= "T" >any object that implements the IComparable interface</typeparam> - /// <param name= "a" >Compare Object A</param> - /// <param name= "B" >Compare object B</param> + /// <returns></returns> - Private Static BOOLA_get_b<t> (t A, T B)wheret:icomparable + { A returnA.compareto (b) >=0; at } - - /// <summary> - ///decision A is less than B (A.compareto (b) >0) - /// </summary> - /// <typeparam name= "T" >any object that implements the IComparable interface</typeparam> in /// <param name= "a" >Compare Object A</param> - /// <param name= "B" >Compare object B</param> to /// <returns></returns> + Private Static BOOLA_lt_b<t> (t A, T B)wheret:icomparable - { the returnA.compareto (b) <0; * } $ Panax Notoginseng /// <summary> - ///decision A Less than or equal to B (A.compareto (B) >=0) the /// </summary> + /// <typeparam name= "T" >any object that implements the IComparable interface</typeparam> A /// <param name= "a" >Compare Object A</param> the /// <param name= "B" >Compare object B</param> + /// <returns></returns> - Private Static BOOLA_let_b<t> (t A, T B)wheret:icomparable $ { $ returnA.compareto (b) <=0; -}
View Code
CSharp any comparable data type (size comparison generic implementation method) encapsulation