-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClDouble.java
66 lines (51 loc) · 1.42 KB
/
ClDouble.java
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// $Id$
//
// Cassowary Incremental Constraint Solver
// Original Smalltalk Implementation by Alan Borning
// This Java Implementation by Greg J. Badros, <[email protected]>
// http://www.cs.washington.edu/homes/gjb
// (C) 1998, 1999 Greg J. Badros and Alan Borning
// See ../LICENSE for legal details regarding this software
//
// ClDouble
//
package EDU.Washington.grad.gjb.cassowary;
public class ClDouble extends Number
{
public ClDouble(double val)
{ value = val; }
public ClDouble()
{ this(0.0); }
public final Object clone()
{ return new ClDouble(value); }
public final double doubleValue()
{ return value; }
public final int intValue()
{ return (int) value; }
public final long longValue()
{ return (long) value; }
public final float floatValue()
{ return (float) value; }
public final byte byteValue()
{ return (byte) value; }
public final short shortValue()
{ return (short) value; }
public final void setValue(double val)
{ value = val; }
public final String toString()
{ return java.lang.Double.toString(value); }
public final boolean equals(Object o)
{
try {
return value == ((ClDouble) o).value;
} catch (Exception err) {
return false;
}
}
public final int hashCode()
{
System.err.println("ClDouble.hashCode() called!");
return (int) java.lang.Double.doubleToLongBits(value);
}
private double value;
}