summaryrefslogtreecommitdiff
path: root/sources/scala/runtime/BoxedLong.java
blob: ebc86e4c92be67526cce3896b77e29a33a0ddff2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2005, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */
package scala.runtime;

public class BoxedLong extends BoxedNumber
    implements java.io.Serializable
{

    public static BoxedLong box(long value) {
	return new BoxedLong(value);
    }

    public final long value;

    private BoxedLong(long value) { this.value = value; }

    public final byte byteValue() { return (byte)value; }
    public final short shortValue() { return (short)value; }
    public final char charValue() { return (char)value; }
    public final int intValue() { return (int)value; }
    public final long longValue() { return (long)value; }
    public final float floatValue() { return (float)value; }
    public final double doubleValue() { return (double)value; }

    public final boolean $eq$eq(java.lang.Object other) {
        return equals(other);
    }

    public final boolean $bang$eq(java.lang.Object other) {
        return !equals(other);
    }

    public boolean equals(java.lang.Object other) {
      return other instanceof BoxedNumber && value == ((BoxedNumber) other).longValue();
    }

    public int hashCode() {
	long bits = value;
	return (int)(bits ^ (bits >>> 32));
    }

    public String toString() {
      return String.valueOf(value);
    }
}