KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * <copyright>
3  *
4  * Copyright (c) 2003-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: FeatureMap.java,v 1.3 2005/06/08 06:20:10 nickb Exp $
16  */

17 package org.eclipse.emf.ecore.util;
18
19
20 import java.util.Collection JavaDoc;
21 import java.util.Iterator JavaDoc;
22 import java.util.List JavaDoc;
23 import java.util.ListIterator JavaDoc;
24
25 import org.eclipse.emf.common.notify.NotificationChain;
26 import org.eclipse.emf.common.util.EList;
27 import org.eclipse.emf.ecore.EObject;
28 import org.eclipse.emf.ecore.EStructuralFeature;
29
30
31 /**
32  * A list of entries where each entry consists of a feature and a single value of that feature's type.
33  */

34 public interface FeatureMap extends EList
35 {
36   /**
37    * A pair consisting of a feature and a single value of that feature's type.
38    */

39   public interface Entry
40   {
41     /**
42      * Returns the feature.
43      * @return the feature.
44      */

45     EStructuralFeature getEStructuralFeature();
46
47     /**
48      * Returns the value.
49      * @return the value.
50      */

51     Object JavaDoc getValue();
52   }
53   
54   public interface ValueListIterator extends EContentsEList.FeatureListIterator
55   {
56     void add(EStructuralFeature eStructuralFeature, Object JavaDoc value);
57   }
58   
59   ValueListIterator valueListIterator();
60   ValueListIterator valueListIterator(int index);
61
62   EList list(EStructuralFeature feature);
63
64   EStructuralFeature getEStructuralFeature(int index);
65   Object JavaDoc getValue(int index);
66   Object JavaDoc setValue(int index, Object JavaDoc value);
67
68   Object JavaDoc get(EStructuralFeature feature, boolean resolve);
69   void set(EStructuralFeature feature, Object JavaDoc object);
70   boolean isSet(EStructuralFeature feature);
71   void unset(EStructuralFeature feature);
72
73   boolean add(EStructuralFeature feature, Object JavaDoc value);
74   void add(int index, EStructuralFeature feature, Object JavaDoc value);
75
76   boolean addAll(EStructuralFeature feature, Collection JavaDoc values);
77   boolean addAll(int index, EStructuralFeature feature, Collection JavaDoc values);
78
79   interface Internal extends FeatureMap, InternalEList, EStructuralFeature.Setting
80   {
81     int getModCount();
82     EObject getEObject();
83
84     Object JavaDoc resolveProxy(EStructuralFeature feature, int entryIndex, int index, Object JavaDoc object);
85
86     int size(EStructuralFeature feature);
87     boolean isEmpty(EStructuralFeature feature);
88     boolean contains(EStructuralFeature feature, Object JavaDoc object);
89     boolean containsAll(EStructuralFeature feature, Collection JavaDoc collection);
90     int indexOf(EStructuralFeature feature, Object JavaDoc object);
91     int lastIndexOf(EStructuralFeature feature, Object JavaDoc object);
92     Iterator JavaDoc iterator(EStructuralFeature feature);
93     ListIterator JavaDoc listIterator(EStructuralFeature feature);
94     ListIterator JavaDoc listIterator(EStructuralFeature feature, int index);
95     // List subList(EStructuralFeature feature, int from, int to);
96
// EList list(EStructuralFeature feature);
97
EStructuralFeature.Setting setting(EStructuralFeature feature);
98     List JavaDoc basicList(EStructuralFeature feature);
99     Iterator JavaDoc basicIterator(EStructuralFeature feature);
100     ListIterator JavaDoc basicListIterator(EStructuralFeature feature);
101     ListIterator JavaDoc basicListIterator(EStructuralFeature feature, int index);
102     Object JavaDoc[] toArray(EStructuralFeature feature);
103     Object JavaDoc[] toArray(EStructuralFeature feature, Object JavaDoc [] array);
104     void add(EStructuralFeature feature, int index, Object JavaDoc object);
105     boolean addAll(EStructuralFeature feature, int index, Collection JavaDoc collection);
106     void addUnique(EStructuralFeature feature, Object JavaDoc object);
107     void addUnique(EStructuralFeature feature, int index, Object JavaDoc object);
108     NotificationChain basicAdd(EStructuralFeature feature, Object JavaDoc object, NotificationChain notifications);
109     boolean remove(EStructuralFeature feature, Object JavaDoc object);
110     Object JavaDoc remove(EStructuralFeature feature, int index);
111     boolean removeAll(EStructuralFeature feature, Collection JavaDoc collection);
112     NotificationChain basicRemove(EStructuralFeature feature, Object JavaDoc object, NotificationChain notifications);
113     boolean retainAll(EStructuralFeature feature, Collection JavaDoc collection);
114     void clear(EStructuralFeature feature);
115     void move(EStructuralFeature feature, int index, Object JavaDoc object);
116     Object JavaDoc move(EStructuralFeature feature, int targetIndex, int sourceIndex);
117     Object JavaDoc get(EStructuralFeature feature, int index, boolean resolve);
118     Object JavaDoc set(EStructuralFeature feature, int index, Object JavaDoc object);
119     Object JavaDoc setUnique(EStructuralFeature feature, int index, Object JavaDoc object);
120   }
121 }
122
Popular Tags