KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > ext > StoredClass


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10 Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11 Suite 350, San Mateo, CA 94403, USA.
12
13 db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

21 package com.db4o.ext;
22
23 /**
24  * the internal representation of a stored class.
25  */

26 public interface StoredClass
27 {
28     
29     /**
30      * returns the name of this stored class.
31      */

32     public String JavaDoc getName();
33     
34     
35     /**
36      * returns an array of IDs of all stored object instances of this stored class.
37      */

38     public long[] getIDs();
39     
40     /**
41      * returns the StoredClass for the parent of the class, this StoredClass represents.
42      */

43     public StoredClass getParentStoredClass();
44     
45     /**
46      * returns all stored fields of this stored class.
47      */

48     public StoredField[] getStoredFields();
49     
50     /**
51      * renames this stored class.
52      * <br><br>After renaming one or multiple classes the ObjectContainer has
53      * to be closed and reopened to allow internal caches to be refreshed.
54      * <br><br>.NET: As the name you should provide [Classname, Assemblyname]<br><br>
55      * @param name the new name
56      */

57     public void rename(String JavaDoc name);
58     
59     // TODO: add field creation
60

61     /**
62      * returns an existing stored field of this stored class.
63      * @param name the name of the field
64      * @param type the type of the field.
65      * There are four possibilities how to supply the type:<br>
66      * - a Class object. (.NET: a Type object)<br>
67      * - a fully qualified classname.<br>
68      * - any object to be used as a template.<br><br>
69      * - null, if the first found field should be returned.
70      * @return the {@link StoredField}
71      */

72     public StoredField storedField(String JavaDoc name, Object JavaDoc type);
73      
74 }
75
Popular Tags