01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Library License version 1 published by ozone-db.org.
03: //
04: // The original code and portions created by SMB are
05: // Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
06: //
07: // $Id: DxDouble.java,v 1.1 2001/12/18 10:31:30 per_nyfelt Exp $
08:
09: package org.ozoneDB.DxLib;
10:
11: import java.io.*;
12:
13: public class DxDouble extends DxObject implements Externalizable {
14:
15: final static long serialVersionUID = 1L;
16:
17: double value = 0;
18:
19: public DxDouble() {
20: }
21:
22: public DxDouble(double v) {
23: value = v;
24: }
25:
26: public DxDouble(DxDouble v) {
27: super ();
28: value = v.value;
29: }
30:
31: public Object clone() {
32: return new DxDouble(value);
33: }
34:
35: public boolean equals(Object obj) {
36: return value == ((DxDouble) obj).value;
37: }
38:
39: public boolean isLess(DxCompatible obj) {
40: return value < ((DxDouble) obj).value;
41: }
42:
43: public String toString() {
44: return Double.toString(value);
45: }
46:
47: public double toDouble() {
48: return value;
49: }
50:
51: public int hashCode() {
52: //die fehlenden bits dann mit equals()
53: return (int) value;
54: }
55:
56: public void writeExternal(ObjectOutput out) throws IOException {
57: out.writeDouble(value);
58: }
59:
60: public void readExternal(ObjectInput in) throws IOException,
61: ClassNotFoundException {
62: value = in.readDouble();
63: }
64: }
|