예제 #1
0
 public override bool Equals(object obj)
 {
     if (obj is RefX1 <T> )
     {
         RefX1 <T> v = (RefX1 <T>)obj;
         return(CompareTo(v) == 0);
     }
     return(false);
 }
예제 #2
0
 public int CompareTo(RefX1 <T> obj)
 {
     if (null == obj)
     {
         return(1);
     }
     if (null == _val)
     {
         if (null == obj.Val)
         {
             return(0);
         }
         else
         {
             return(-1);
         }
     }
     return(_val.CompareTo(obj.Val));
 }
예제 #3
0
        private static RefX1 <int>[] PrepTests(RefX1IntGenerator generator, int count,
                                               out RefX1 <int>[] toRemove, out RefX1 <int>[] afterRemove)
        {
            RefX1 <int>[] entireArray = new RefX1 <int> [count];
            toRemove    = new RefX1 <int> [count / 2];
            afterRemove = new RefX1 <int> [count / 2];
            for (int i = 0; i < 100; i++)
            {
                entireArray[i] = generator.NextValue();

                if ((i & 1) != 0)
                {
                    toRemove[i / 2] = entireArray[i];
                }
                else
                {
                    afterRemove[i / 2] = entireArray[i];
                }
            }

            return(entireArray);
        }
예제 #4
0
 public bool Equals(RefX1 <T> x)
 {
     return(0 == CompareTo(x));
 }