01: // You can redistribute this software and/or modify it under the terms of
02: // the Ozone Core 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: TransactionData.java,v 1.1 2001/12/18 10:31:31 per_nyfelt Exp $
08:
09: package org.ozoneDB.core.wizardStore;
10:
11: import org.ozoneDB.core.*;
12: import org.ozoneDB.util.*;
13: import org.ozoneDB.DxLib.*;
14:
15: /**
16: * @author <a href="http://www.softwarebuero.de/">SMB</a>
17: * @version $Revision: 1.1 $Date: 2001/12/18 10:31:31 $
18: */
19: final class TransactionData {
20:
21: public final static int DEFAULT_TABLE_SIZE = 1024;
22:
23: protected ClusterID lrucid;
24:
25: protected DxMap idTable;
26:
27: // initialized by WizardStore.nameContainer() if needed
28: protected DxMap nameTable;
29:
30: protected DxSet commitClusterIDs;
31:
32: private DxDeque idTableChanges;
33:
34: private DxDeque nameTableChanges;
35:
36: public TransactionData() {
37: idTable = new DxHashMap(DEFAULT_TABLE_SIZE);
38: }
39:
40: public void nameTableChanges_push(NameTableChange change) {
41: if (nameTableChanges == null) {
42: nameTableChanges = new DxListDeque( /*DEFAULT_TABLE_SIZE*/);
43: }
44: nameTableChanges.pushTop(change);
45: }
46:
47: public NameTableChange nameTableChanges_pop() {
48: return nameTableChanges != null ? (NameTableChange) nameTableChanges
49: .popBottom()
50: : null;
51: }
52:
53: public void idTableChanges_push(IDTableChange change) {
54: if (idTableChanges == null) {
55: idTableChanges = new DxListDeque( /*DEFAULT_TABLE_SIZE*/);
56: }
57: idTableChanges.pushTop(change);
58: }
59:
60: public IDTableChange idTableChanges_pop() {
61: return idTableChanges != null ? (IDTableChange) idTableChanges
62: .popBottom() : null;
63: }
64: }
|