KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > emf > ecore > util > EObjectWithInverseResolvingEList


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: EObjectWithInverseResolvingEList.java,v 1.4 2005/06/08 06:20:10 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.util;
18
19
20 import org.eclipse.emf.ecore.EObject;
21 import org.eclipse.emf.ecore.InternalEObject;
22
23
24 public class EObjectWithInverseResolvingEList extends EObjectWithInverseEList
25 {
26   public static class Unsettable extends EObjectWithInverseEList.Unsettable
27   {
28     public static class ManyInverse extends EObjectWithInverseResolvingEList.Unsettable
29     {
30       public ManyInverse(Class JavaDoc dataClass, InternalEObject owner, int featureID, int inverseFeatureID)
31       {
32         super(dataClass, owner, featureID, inverseFeatureID);
33       }
34
35       protected boolean hasManyInverse()
36       {
37         return true;
38       }
39     }
40
41     public Unsettable(Class JavaDoc dataClass, InternalEObject owner, int featureID, int inverseFeatureID)
42     {
43       super(dataClass, owner, featureID, inverseFeatureID);
44     }
45
46     protected boolean hasProxies()
47     {
48       return true;
49     }
50     
51     protected Object JavaDoc resolve(int index, Object JavaDoc object)
52     {
53       // jdk 1.3 requires this explicity cast
54
return ((EcoreEList)this).resolve(index, (EObject)object);
55     }
56   }
57
58   public static class ManyInverse extends EObjectWithInverseResolvingEList
59   {
60     public ManyInverse(Class JavaDoc dataClass, InternalEObject owner, int featureID, int inverseFeatureID)
61     {
62       super(dataClass, owner, featureID, inverseFeatureID);
63     }
64
65     protected boolean hasManyInverse()
66     {
67       return true;
68     }
69   }
70
71   public EObjectWithInverseResolvingEList
72     (Class JavaDoc dataClass, InternalEObject owner, int featureID, int inverseFeatureID)
73   {
74     super(dataClass, owner, featureID, inverseFeatureID);
75   }
76
77   protected boolean hasProxies()
78   {
79     return true;
80   }
81   
82   protected Object JavaDoc resolve(int index, Object JavaDoc object)
83   {
84     // jdk 1.3 requires this explicity cast
85
return ((EcoreEList)this).resolve(index, (EObject)object);
86   }
87 }
88
Popular Tags