KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > mapping > MappingRoot


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2002-2004 IBM Corporation and others.
5  * All rights reserved. This program and the accompanying materials
6  * are made available under the terms of the Eclipse Public License v1.0
7  * which accompanies this distribution, and is available at
8  * http://www.eclipse.org/legal/epl-v10.html
9  *
10  * Contributors:
11  * IBM - Initial API and implementation
12  *
13  * </copyright>
14  *
15  * $Id: MappingRoot.java,v 1.3 2005/06/08 06:21:43 nickb Exp $
16  */

17 package org.eclipse.emf.mapping;
18
19
20 import java.util.Collection JavaDoc;
21
22 import org.eclipse.emf.mapping.domain.MappingDomain;
23
24
25 /**
26  * <!-- begin-user-doc -->
27  * A representation of the model object '<em><b>Root</b></em>'.
28  * <!-- end-user-doc -->
29  *
30  * <p>
31  * The following features are supported:
32  * <ul>
33  * <li>{@link org.eclipse.emf.mapping.MappingRoot#isOutputReadOnly <em>Output Read Only</em>}</li>
34  * <li>{@link org.eclipse.emf.mapping.MappingRoot#isTopToBottom <em>Top To Bottom</em>}</li>
35  * <li>{@link org.eclipse.emf.mapping.MappingRoot#getCommandStack <em>Command Stack</em>}</li>
36  * </ul>
37  * </p>
38  *
39  * @see org.eclipse.emf.mapping.MappingPackage#getMappingRoot()
40  * @model
41  * @generated
42  */

43 public interface MappingRoot extends Mapping
44 {
45   /**
46    * Returns the value of the '<em><b>Output Read Only</b></em>' attribute.
47    * <!-- begin-user-doc -->
48    * <p>
49    * If the meaning of the '<em>Output Read Only</em>' attribute isn't clear,
50    * there really should be more of a description here...
51    * </p>
52    * <!-- end-user-doc -->
53    * @return the value of the '<em>Output Read Only</em>' attribute.
54    * @see #setOutputReadOnly(boolean)
55    * @see org.eclipse.emf.mapping.MappingPackage#getMappingRoot_OutputReadOnly()
56    * @model
57    * @generated
58    */

59   boolean isOutputReadOnly();
60
61   /**
62    * Sets the value of the '{@link org.eclipse.emf.mapping.MappingRoot#isOutputReadOnly <em>Output Read Only</em>}' attribute.
63    * <!-- begin-user-doc -->
64    * <!-- end-user-doc -->
65    * @param value the new value of the '<em>Output Read Only</em>' attribute.
66    * @see #isOutputReadOnly()
67    * @generated
68    */

69   void setOutputReadOnly(boolean value);
70
71   /**
72    * Returns the value of the '<em><b>Top To Bottom</b></em>' attribute.
73    * <!-- begin-user-doc -->
74    * <p>
75    * If the meaning of the '<em>Top To Bottom</em>' attribute isn't clear,
76    * there really should be more of a description here...
77    * </p>
78    * <!-- end-user-doc -->
79    * @return the value of the '<em>Top To Bottom</em>' attribute.
80    * @see #setTopToBottom(boolean)
81    * @see org.eclipse.emf.mapping.MappingPackage#getMappingRoot_TopToBottom()
82    * @model
83    * @generated
84    */

85   boolean isTopToBottom();
86
87   /**
88    * Sets the value of the '{@link org.eclipse.emf.mapping.MappingRoot#isTopToBottom <em>Top To Bottom</em>}' attribute.
89    * <!-- begin-user-doc -->
90    * <!-- end-user-doc -->
91    * @param value the new value of the '<em>Top To Bottom</em>' attribute.
92    * @see #isTopToBottom()
93    * @generated
94    */

95   void setTopToBottom(boolean value);
96
97   /**
98    * Returns the value of the '<em><b>Command Stack</b></em>' attribute.
99    * <!-- begin-user-doc -->
100    * <p>
101    * If the meaning of the '<em>Command Stack</em>' attribute isn't clear,
102    * there really should be more of a description here...
103    * </p>
104    * <!-- end-user-doc -->
105    * @return the value of the '<em>Command Stack</em>' attribute.
106    * @see #setCommandStack(String)
107    * @see org.eclipse.emf.mapping.MappingPackage#getMappingRoot_CommandStack()
108    * @model
109    * @generated
110    */

111   String JavaDoc getCommandStack();
112
113   /**
114    * Sets the value of the '{@link org.eclipse.emf.mapping.MappingRoot#getCommandStack <em>Command Stack</em>}' attribute.
115    * <!-- begin-user-doc -->
116    * <!-- end-user-doc -->
117    * @param value the new value of the '<em>Command Stack</em>' attribute.
118    * @see #getCommandStack()
119    * @generated
120    */

121   void setCommandStack(String JavaDoc value);
122
123   /**
124    * This returns the associated mapping domain.
125    */

126   MappingDomain getDomain();
127
128   /**
129    * This sets the domain of this mapping root.
130    */

131   void setDomain(MappingDomain domain);
132
133   /**
134    * This refreshes the mapped objects states of all mappings rooted at the specified mapping subtree.
135    */

136   void refreshMappedObjectStates(Mapping subtree);
137
138   /**
139    * This returns a collection of the mappings that refer to the given object.
140    */

141   Collection JavaDoc getMappings(Object JavaDoc object);
142
143   /**
144    * This returns the <bf>intersection</bf> of the result of {@link #getMappings(Object) getMappings(Object)}
145    * for each object of the collection.
146    */

147   Collection JavaDoc getAllMappings(Collection JavaDoc collection);
148
149   /**
150    * This returns the subset of mappings returned by {@link #getAllMappings}
151    * such that have each mapping has <bf>exactly</bf> the collection as its mapped objects,
152    * i.e., as return by {@link org.eclipse.emf.mapping.Mapping#getMappedObjects() Mapping#getMappedObjects()}.
153    */

154   Collection JavaDoc getExactMappings(Collection JavaDoc collection);
155
156   /**
157    * This returns the mapping in the tree that would be the parent of a mapping that has the given collection as its mapped objects.
158    */

159   Mapping getParentMapping(Collection JavaDoc collection);
160
161   /**
162    * If mapping is null, this checks if a mapping can be created with the given inputs and outputs. If mapping is
163    * not null, it checks if the specified mapping can be changed to the given inputs and outputs.
164    */

165   boolean canCreateMapping(Collection JavaDoc inputs, Collection JavaDoc outputs, Mapping mapping);
166
167   /**
168    * This checks if the given mapping can be removed.
169    */

170   boolean canRemoveMapping(Mapping mapping);
171
172   /**
173    * This creates a new, appropriately-parented, mapping object with the given collections of input and output objects.
174    */

175   Mapping createMapping(Collection JavaDoc inputs, Collection JavaDoc outputs);
176
177   /**
178    * This method resets the mapping and output dirty flags.
179    */

180   void resetDirty();
181
182   /**
183    * This method returns true if the mapping tree needs to be saved.
184    */

185   boolean isDirty();
186
187   /**
188    * This method returns true if the mapping output needs to be saved.
189    */

190   boolean isOutputDirty();
191
192   /**
193    * This method sets the output dirty flag.
194    */

195   void setOutputDirty(boolean dirty);
196
197   /**
198    * This returns whether the given object is an input object in the domain.
199    */

200   boolean isInputObject(Object JavaDoc object);
201
202   /**
203    * This returns whether the given object is an output object in the domain.
204    */

205   boolean isOutputObject(Object JavaDoc object);
206
207   /**
208    * This returns whether the given object is a top domain object.
209    */

210   boolean isTopObject(Object JavaDoc object);
211
212   /**
213    * This returns whether the given object is a bottom domain object.
214    */

215   boolean isBottomObject(Object JavaDoc object);
216
217   /**
218    * This returns whether the given object descends from one of the root's input or output objects.
219    */

220   boolean isAttachedObject(Object JavaDoc object);
221
222   /**
223    * This adds cached information about this mapping.
224    */

225   void register(Mapping mapping);
226
227   /**
228    * This removes cached information about this mapping.
229    */

230   void deregister(Mapping mapping);
231
232   /**
233    * This returns the mapping state, if any, of the given object.
234    */

235   MappedObjectState getMappedObjectState(Object JavaDoc object);
236
237   /**
238    * This returns the root of the type mapping model.
239    */

240   MappingRoot getTypeMappingRoot();
241
242   /**
243    * This disposes all the adapters used to record the mapped object state.
244    */

245   void dispose();
246
247 } // MappingRoot
248

249
Popular Tags