Example #1
0
        /**
         * Determine if two numbers are equal. Numbers are equal if they contain the
         * same value.
         *
         * @param o
         *                the number to compare to.
         *
         * @return true if the numbers have the same value.
         */
        public override bool Equals(Object o)
        {
            if (!(o is OtpErlangLong))
            {
                return(false);
            }

            OtpErlangLong that = (OtpErlangLong)o;

            if (!BigIntegerIsNull(bigVal) && !BigIntegerIsNull(that.bigVal))
            {
                return(bigVal.Equals(that.bigVal));
            }
            else if (BigIntegerIsNull(bigVal) && BigIntegerIsNull(that.bigVal))
            {
                return(val == that.val);
            }
            return(false);
        }
Example #2
0
 /**
  * Convert a list of integers into a Unicode string,
  * interpreting each integer as a Unicode code point value.
  *
  * @return A java.lang.String object created through its
  *         constructor String(int[], int, int).
  *
  * @exception OtpErlangException
  *                    for non-proper and non-integer lists.
  *
  * @exception OtpErlangRangeException
  *                    if any integer does not fit into a Java int.
  *
  * @exception java.security.InvalidParameterException
  *                    if any integer is not within the Unicode range.
  *
  * @see String#String(int[], int, int)
  *
  */
 public String stringValue()
 {
     if (!isProper())
     {
         throw new OtpErlangException("Non-proper list: " + this);
     }
     char[] values = new char[arity()];
     for (int i = 0; i < values.Length; ++i)
     {
         OtpErlangObject o = elementAt(i);
         if (!(o is OtpErlangLong))
         {
             throw new OtpErlangException("Non-integer term: " + o);
         }
         OtpErlangLong l = (OtpErlangLong)o;
         values[i] = (char)l.intValue();
     }
     return(new String(values, 0, values.Length));
 }