Ejemplo n.º 1
0
        // Equals is based on val and unit (NaN == NaN)
        public override bool hequals(object that)
        {
            if (!(that is HNum))
            {
                return(false);
            }
            HNum x = (HNum)that;

            if (double.IsNaN(doubleval))
            {
                return(double.IsNaN(x.doubleval));
            }
            if (doubleval != x.doubleval)
            {
                return(false);
            }
            if (unit == null)
            {
                return(x.unit == null);
            }
            if (x.unit == null)
            {
                return(false);
            }
            return(unit.Equals(x.unit));
        }
Ejemplo n.º 2
0
 public static HaystackNumber Map(HNum value)
 {
     return(value.Source);
 }
Ejemplo n.º 3
0
 // Convenience for <code>add(name, HNum.make(val, unit))</code>
 public HDictBuilder add(string name, double val, string unit)
 {
     return(add(name, HNum.make(val, unit)));
 }
Ejemplo n.º 4
0
 // Convenience for <code>add(name, HNum.make(val, unit))</code>
 public HDictBuilder add(string name, long val, String unit)
 {
     return(add(name, HNum.make(val, unit)));
 }
Ejemplo n.º 5
0
        //////////////////////////////////////////////////////////////////////////
        // Watches
        //////////////////////////////////////////////////////////////////////////

        /**
         * Create a new watch with an empty subscriber list.  The dis
         * string is a debug string to keep track of who created the watch.
         * Pass the desired lease time or null to use default.
         */
        public abstract HWatch watchOpen(String dis, HNum lease);