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: DxLong.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 DxLong extends DxObject implements Externalizable {
14:
15: final static long serialVersionUID = 1L;
16:
17: long value = 0;
18:
19: public DxLong() {
20: }
21:
22: public DxLong(long v) {
23: value = v;
24: }
25:
26: public DxLong(DxLong v) {
27: super ();
28: value = v.value;
29: }
30:
31: public Object clone() {
32: return new DxLong(value);
33: }
34:
35: public boolean equals(Object obj) {
36: return value == ((DxLong) obj).value;
37: }
38:
39: public boolean isLess(DxCompatible obj) {
40: return value < ((DxLong) obj).value;
41: }
42:
43: public String toString() {
44: return Long.toString(value);
45: }
46:
47: public long toLong() {
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.writeLong(value);
58: }
59:
60: public void readExternal(ObjectInput in) throws IOException,
61: ClassNotFoundException {
62: value = in.readLong();
63: }
64: }
|