KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jdo > api > persistence > model > jdo > FieldElementHolder


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * FieldElementHolder.java
26  *
27  * Created on February 28, 2000, 3:55 PM
28  */

29
30 package com.sun.jdo.api.persistence.model.jdo;
31
32 import com.sun.jdo.api.persistence.model.ModelException;
33
34 /**
35  *
36  * @author raccah
37  * @version %I%
38  */

39 public interface FieldElementHolder
40 {
41     /** Add the supplied field to the collection of fields maintained by this
42      * holder.
43      * @param field the field to be added
44      * @exception ModelException if impossible
45      */

46     public void addField (PersistenceFieldElement field)
47         throws ModelException;
48
49     /** Add the supplied fields to the collection of fields maintained by this
50      * holder.
51      * @param fields the array of fields to be added
52      * @exception ModelException if impossible
53      */

54     public void addFields (PersistenceFieldElement[] fields)
55         throws ModelException;
56
57     /** Remove the supplied field from the collection of fields maintained by
58      * this holder.
59      * @param field the field to be removed
60      * @exception ModelException if impossible
61      */

62     public void removeField (PersistenceFieldElement field)
63         throws ModelException;
64
65     /** Removed the supplied fields from the collection of fields maintained
66      * by this holder.
67      * @param fields the array of fields to be removed
68      * @exception ModelException if impossible
69      */

70     public void removeFields (PersistenceFieldElement[] fields)
71         throws ModelException;
72
73     /** Returns the collection of fields maintained by this holder in the form
74      * of an array.
75      * @return the fields maintained by this holder
76      */

77     public PersistenceFieldElement[] getFields ();
78
79     /** Sets the collection of fields maintained by this holder to the contents
80      * of the supplied array.
81      * @param fields the fields maintained by this holder
82      * @exception ModelException if impossible
83      */

84     public void setFields (PersistenceFieldElement[] fields)
85         throws ModelException;
86
87     /** Returns the field with the supplied name from the collection of fields
88      * maintained by this holder.
89      * @param name the name to match
90      * @return the field with the supplied name, <code>null</code> if none exists
91      */

92     public PersistenceFieldElement getField (String JavaDoc name);
93
94     /** Tests whether the supplied field is in the collection of fields
95      * maintained by this holder.
96      * @param field the field to be tested
97      */

98     public boolean containsField (PersistenceFieldElement field);
99 }
100
Popular Tags