KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > tools > ClusterStats


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: ClusterStats.java,v 1.2 2002/09/18 06:54:18 per_nyfelt Exp $
8

9 package org.ozoneDB.tools;
10
11 import org.ozoneDB.DxLib.DxObject;
12
13
14 public class ClusterStats extends DxObject {
15     int member = 6;
16     int[] counter = new int[member];
17     
18     
19     public ClusterStats() {
20         for (int i = 0; i < member; i++) {
21             counter[i] = 0;
22         }
23     }
24     
25     
26     public String JavaDoc toString() {
27         return
28                 "\nobjects loaded : " + counter[0] + " cluster loaded : " + counter[3] + "\nobjects stored : "
29                 + counter[1] + " cluster stored : " + counter[4] + "\nobjects deleted : " + counter[2]
30                 + " cluster deleted : " + counter[5];
31     }
32     
33     
34     public void objectLoaded() {
35         counter[0]++;
36     }
37     
38     
39     public void objectStored() {
40         counter[1]++;
41     }
42     
43     
44     public void objectDeleted() {
45         counter[2]++;
46     }
47     
48     
49     public void clusterLoaded() {
50         counter[3]++;
51     }
52     
53     
54     public void clusterStored() {
55         counter[4]++;
56     }
57     
58     
59     public void clusterDeleted() {
60         counter[5]++;
61     }
62     
63 }
64
Popular Tags