KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > metainfo > api > GenClass


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

23
24 package org.objectweb.jorm.metainfo.api;
25
26 import org.objectweb.jorm.type.api.PType;
27
28 import java.util.Iterator JavaDoc;
29
30 /**
31  * The GenClass interface defines generic class object which are
32  * used to gather other objects.
33  * @author X. Spengler
34  */

35 public interface GenClass extends MetaObject {
36     /**
37      * Allows to know the name of the current generic class object.
38      *
39      * @return the string representation of the generic class name
40      */

41     String JavaDoc getName();
42
43     /**
44      * Returns a new PrimitiveElement object, created with its name
45      * and its type (PType).
46      * As the current Class is generic, the field of the class is an
47      * index field. If the field already exists, it is returned, else a new
48      * one is created.
49      *
50      * @param indexFieldName the name of the index field
51      * @param type the type of the index field
52      * @return a new PrimitiveField for the current generic class
53      */

54     PrimitiveElement createIndexField(String JavaDoc indexFieldName, PType type);
55
56     /**
57      * Returns the PrimitiveElement corresponding to its name.
58      * If no field corresponds to this name, null is returned.
59      *
60      * @param indexfieldname the name of the index field
61      * @return an existing index field. If the index field does not exist,
62      * null is returned.
63      */

64     PrimitiveElement getIndexField(String JavaDoc indexfieldname);
65
66     /**
67      * Allows to know all the existing index field for the current generic
68      * class.
69      * This iterator contains PrimitiveElement objects. If no index field
70      * exists, an empty iterator is returned.
71      *
72      * @return an Iterator on index field (PrimitiveElement). If there is no
73      * index field to return, an empty iterator is returned.
74      */

75     Iterator JavaDoc iterateIndexField();
76
77     /**
78      * Returns the number of index fields for the current generic class.
79      *
80      * @return the integer number of the index fields for the generic class
81      */

82     int getIndexFieldNumber();
83 }
84
Popular Tags