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: DxInteger.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 DxInteger extends DxObject implements Externalizable {
14:
15: final static long serialVersionUID = 1L;
16:
17: int value = 0;
18:
19: public DxInteger() {
20: }
21:
22: public DxInteger(int v) {
23: value = v;
24: }
25:
26: public DxInteger(DxInteger v) {
27: super ();
28: value = v.value;
29: }
30:
31: public Object clone() {
32: return new DxInteger(value);
33: }
34:
35: public boolean equals(Object obj) {
36: if (obj instanceof DxInteger && obj != null) {
37: return value == ((DxInteger) obj).value;
38: } else {
39: return false;
40: }
41: }
42:
43: public boolean isLess(DxCompatible obj) {
44: return value < ((DxInteger) obj).value;
45: }
46:
47: public String toString() {
48: return Integer.toString(value);
49: }
50:
51: public int toInt() {
52: return value;
53: }
54:
55: public int hashCode() {
56: return value;
57: }
58:
59: public void writeExternal(ObjectOutput out) throws IOException {
60: out.writeInt(value);
61: }
62:
63: public void readExternal(ObjectInput in) throws IOException,
64: ClassNotFoundException {
65: value = in.readInt();
66: }
67: }
|