78
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2006, 2008 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Brad Reynolds - bug 167204
|
|
11 * Matthew Hall - bug 208858
|
|
12 *******************************************************************************/
|
|
13
|
|
14 module org.eclipse.core.databinding.observable.list.IObservableList;
|
81
|
15 import org.eclipse.core.databinding.observable.list.IListChangeListener;
|
78
|
16
|
|
17 import java.lang.all;
|
|
18
|
|
19 import java.util.Collection;
|
|
20 import java.util.Iterator;
|
|
21 import java.util.List;
|
|
22 import java.util.ListIterator;
|
|
23
|
|
24 import org.eclipse.core.databinding.observable.IObservableCollection;
|
|
25
|
|
26 /**
|
|
27 * A list whose changes can be tracked by list change listeners.
|
|
28 *
|
|
29 * @noextend This interface is not intended to be extended by clients.
|
|
30 * @noimplement This interface is not intended to be implemented by clients.
|
|
31 * Clients should instead subclass one of the framework classes
|
|
32 * that implement this interface. Note that direct implementers of
|
|
33 * this interface outside of the framework will be broken in future
|
|
34 * releases when methods are added to this interface.
|
|
35 *
|
|
36 * @see AbstractObservableList
|
|
37 * @see ObservableList
|
|
38 *
|
|
39 * @since 1.0
|
|
40 */
|
|
41 public interface IObservableList : List, IObservableCollection {
|
85
|
42 alias List.add add;
|
|
43
|
78
|
44 /**
|
|
45 * Adds the given list change listener to the list of list change listeners.
|
|
46 * @param listener
|
|
47 */
|
|
48 public void addListChangeListener(IListChangeListener listener);
|
|
49
|
|
50 /**
|
|
51 * Removes the given list change listener from the list of list change listeners.
|
|
52 * Has no effect if the given listener is not registered as a list change listener.
|
|
53 *
|
|
54 * @param listener
|
|
55 */
|
|
56 public void removeListChangeListener(IListChangeListener listener);
|
|
57
|
|
58 /**
|
|
59 * @TrackedGetter
|
|
60 */
|
|
61 public int size();
|
|
62
|
|
63 /**
|
|
64 * @TrackedGetter
|
|
65 */
|
|
66 public bool isEmpty();
|
|
67
|
|
68 /**
|
|
69 * @TrackedGetter
|
|
70 */
|
|
71 public bool contains(Object o);
|
|
72
|
|
73 /**
|
|
74 * @TrackedGetter
|
|
75 */
|
|
76 public Iterator iterator();
|
|
77
|
|
78 /**
|
|
79 * @TrackedGetter
|
|
80 */
|
|
81 public Object[] toArray();
|
|
82
|
|
83 /**
|
|
84 * @TrackedGetter
|
|
85 */
|
|
86 public Object[] toArray(Object a[]);
|
|
87
|
|
88 /**
|
|
89 *
|
|
90 */
|
|
91 public bool add(Object o);
|
|
92
|
|
93 /**
|
|
94 *
|
|
95 */
|
|
96 public bool remove(Object o);
|
|
97
|
|
98 /**
|
|
99 * @TrackedGetter
|
|
100 */
|
|
101 public bool containsAll(Collection c);
|
|
102
|
|
103 /**
|
|
104 *
|
|
105 */
|
|
106 public bool addAll(Collection c);
|
|
107
|
|
108 /**
|
|
109 *
|
|
110 */
|
|
111 public bool addAll(int index, Collection c);
|
|
112
|
|
113 /**
|
|
114 *
|
|
115 */
|
|
116 public bool removeAll(Collection c);
|
|
117
|
|
118 /**
|
|
119 *
|
|
120 */
|
|
121 public bool retainAll(Collection c);
|
|
122
|
|
123 /**
|
|
124 * @TrackedGetter
|
|
125 */
|
85
|
126 public equals_t opEquals(Object o);
|
78
|
127
|
|
128 /**
|
|
129 * @TrackedGetter
|
|
130 */
|
85
|
131 public hash_t toHash();
|
78
|
132
|
|
133 /**
|
|
134 * @TrackedGetter
|
|
135 */
|
|
136 public Object get(int index);
|
|
137
|
|
138 /**
|
|
139 *
|
|
140 */
|
|
141 public Object set(int index, Object element);
|
|
142
|
|
143 /**
|
|
144 * Moves the element located at <code>oldIndex</code> to
|
|
145 * <code>newIndex</code>. This method is equivalent to calling
|
|
146 * <code>add(newIndex, remove(oldIndex))</code>.
|
|
147 * <p>
|
|
148 * Implementors should deliver list change notification for the remove and
|
|
149 * add operations in the same ListChangeEvent, as this allows
|
|
150 * {@link ListDiff#acceptcast(ListDiffVisitor)} to recognize the operation as a
|
|
151 * move.
|
|
152 *
|
|
153 * @param oldIndex
|
|
154 * the element's position before the move. Must be within the
|
|
155 * range <code>0 <= oldIndex < size()</code>.
|
|
156 * @param newIndex
|
|
157 * the element's position after the move. Must be within the
|
|
158 * range <code>0 <= newIndex < size()</code>.
|
|
159 * @return the element that was moved.
|
|
160 * @throws IndexOutOfBoundsException
|
|
161 * if either argument is out of range (<code>0 <= index < size()</code>).
|
|
162 * @see ListDiffVisitor#handleMove(int, int, Object)
|
|
163 * @see ListDiff#acceptcast(ListDiffVisitor)
|
|
164 * @since 1.1
|
|
165 */
|
|
166 public Object move(int oldIndex, int newIndex);
|
|
167
|
|
168 /**
|
|
169 *
|
|
170 */
|
|
171 public Object remove(int index);
|
|
172
|
|
173 /**
|
|
174 * @TrackedGetter
|
|
175 */
|
|
176 public int indexOf(Object o);
|
|
177
|
|
178 /**
|
|
179 * @TrackedGetter
|
|
180 */
|
|
181 public int lastIndexOf(Object o);
|
|
182
|
|
183 /**
|
|
184 * @TrackedGetter
|
|
185 */
|
|
186 public ListIterator listIterator();
|
|
187
|
|
188 /**
|
|
189 * @TrackedGetter
|
|
190 */
|
|
191 public ListIterator listIterator(int index);
|
|
192
|
|
193 /**
|
|
194 * @TrackedGetter
|
|
195 */
|
|
196 public List subList(int fromIndex, int toIndex);
|
|
197
|
|
198 /**
|
|
199 * @return the type of the elements or <code>null</code> if untyped
|
|
200 */
|
|
201 Object getElementType();
|
|
202 }
|