public override void Copy(MutableValue source)
        {
            MutableValueDouble s = (MutableValueDouble)source;

            Value  = s.Value;
            Exists = s.Exists;
        }
        public override MutableValue Duplicate()
        {
            MutableValueDouble v = new MutableValueDouble();

            v.Value  = this.Value;
            v.Exists = this.Exists;
            return(v);
        }
Exemple #3
0
        public override bool EqualsSameType(object other)
        {
            MutableValueDouble b = (MutableValueDouble)other;

            // LUCENENET specific - compare bits rather than using equality operators to prevent these comparisons from failing in x86 in .NET Framework with optimizations enabled
            return(NumericUtils.DoubleToSortableInt64(Value) == NumericUtils.DoubleToSortableInt64(b.Value) &&
                   Exists == b.Exists);
        }
        public override int CompareSameType(object other)
        {
            MutableValueDouble b = (MutableValueDouble)other;
            int c = Value.CompareTo(b.Value);

            if (c != 0)
            {
                return(c);
            }
            if (!Exists)
            {
                return(-1);
            }
            if (!b.Exists)
            {
                return(1);
            }
            return(0);
        }
        public override bool EqualsSameType(object other)
        {
            MutableValueDouble b = (MutableValueDouble)other;

            return(Value == b.Value && Exists == b.Exists);
        }