01: ///////////////////////////////////////////////////////////////////////////////
02: //
03: // Copyright (C) 2003-@year@ by Thomas M. Hazel, MyOODB (www.myoodb.org)
04: //
05: // All Rights Reserved
06: //
07: // This program is free software; you can redistribute it and/or modify
08: // it under the terms of the GNU General Public License and GNU Library
09: // General Public License as published by the Free Software Foundation;
10: // either version 2, or (at your option) any later version.
11: //
12: // This program is distributed in the hope that it will be useful,
13: // but WITHOUT ANY WARRANTY; without even the implied warranty of
14: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: // GNU General Public License and GNU Library General Public License
16: // for more details.
17: //
18: // You should have received a copy of the GNU General Public License
19: // and GNU Library General Public License along with this program; if
20: // not, write to the Free Software Foundation, 675 Mass Ave, Cambridge,
21: // MA 02139, USA.
22: //
23: ///////////////////////////////////////////////////////////////////////////////
24: package org.myoodb.core;
25:
26: import java.io.*;
27:
28: public abstract class AbstractRootContainer extends
29: AbstractObjectContainer {
30: private String m_name;
31:
32: public AbstractRootContainer() {
33: // XXX: let the JVM initialize our attributes
34: }
35:
36: public AbstractRootContainer(int state, Identifier objectId,
37: String name) {
38: super (state, objectId);
39:
40: m_name = name;
41: }
42:
43: public String getName() {
44: return m_name;
45: }
46:
47: public String toString() {
48: return "RootContainer ( " + getObjectIdentifier() + ", "
49: + getName() + " )";
50: }
51:
52: public void writeExternal(ObjectOutput out) throws IOException {
53: super .writeExternal(out);
54:
55: out.writeObject(m_name);
56: }
57:
58: public void readExternal(ObjectInput in) throws IOException,
59: ClassNotFoundException {
60: super .readExternal(in);
61:
62: m_name = (String) in.readObject();
63: }
64: }
|