Example #1
0
 public override bool Equals(object obj)
 {
     if (obj is ValX1 <T> )
     {
         ValX1 <T> v = (ValX1 <T>)obj;
         return(CompareTo(v) == 0);
     }
     return(false);
 }
Example #2
0
        public int CompareTo(ValX1 <T> obj)
        {
            if (Object.ReferenceEquals(_val, obj._val))
            {
                return(0);
            }

            if (null == _val)
            {
                return(-1);
            }

            return(_val.CompareTo(obj.Val));
        }
Example #3
0
        private static ValX1 <string>[] PrepTests(ValX1stringGenerator generator, int count,
                                                  out ValX1 <string>[] toRemove, out ValX1 <string>[] afterRemove)
        {
            ValX1 <string>[] entireArray = new ValX1 <string> [count];
            toRemove    = new ValX1 <string> [count / 2];
            afterRemove = new ValX1 <string> [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);
        }
Example #4
0
 public bool Equals(ValX1 <T> x)
 {
     return(0 == CompareTo(x));
 }