Mercurial > projects > dwt2
comparison org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/IObservableList.d @ 95:6208d4f6a277
Added trees for databinding.beans and observable
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Tue, 21 Apr 2009 10:55:51 +0200 |
parents | |
children | b74ac5dfcc06 |
comparison
equal
deleted
inserted
replaced
94:1d37a7813832 | 95:6208d4f6a277 |
---|---|
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 package org.eclipse.core.databinding.observable.list; | |
15 | |
16 import java.util.Collection; | |
17 import java.util.Iterator; | |
18 import java.util.List; | |
19 import java.util.ListIterator; | |
20 | |
21 import org.eclipse.core.databinding.observable.IObservableCollection; | |
22 | |
23 /** | |
24 * A list whose changes can be tracked by list change listeners. | |
25 * | |
26 * @noextend This interface is not intended to be extended by clients. | |
27 * @noimplement This interface is not intended to be implemented by clients. | |
28 * Clients should instead subclass one of the framework classes | |
29 * that implement this interface. Note that direct implementers of | |
30 * this interface outside of the framework will be broken in future | |
31 * releases when methods are added to this interface. | |
32 * | |
33 * @see AbstractObservableList | |
34 * @see ObservableList | |
35 * | |
36 * @since 1.0 | |
37 */ | |
38 public interface IObservableList : List, IObservableCollection { | |
39 | |
40 /** | |
41 * Adds the given list change listener to the list of list change listeners. | |
42 * @param listener | |
43 */ | |
44 public void addListChangeListener(IListChangeListener listener); | |
45 | |
46 /** | |
47 * Removes the given list change listener from the list of list change listeners. | |
48 * Has no effect if the given listener is not registered as a list change listener. | |
49 * | |
50 * @param listener | |
51 */ | |
52 public void removeListChangeListener(IListChangeListener listener); | |
53 | |
54 /** | |
55 * @TrackedGetter | |
56 */ | |
57 public int size(); | |
58 | |
59 /** | |
60 * @TrackedGetter | |
61 */ | |
62 public bool isEmpty(); | |
63 | |
64 /** | |
65 * @TrackedGetter | |
66 */ | |
67 public bool contains(Object o); | |
68 | |
69 /** | |
70 * @TrackedGetter | |
71 */ | |
72 public Iterator iterator(); | |
73 | |
74 /** | |
75 * @TrackedGetter | |
76 */ | |
77 public Object[] toArray(); | |
78 | |
79 /** | |
80 * @TrackedGetter | |
81 */ | |
82 public Object[] toArray(Object a[]); | |
83 | |
84 /** | |
85 * | |
86 */ | |
87 public bool add(Object o); | |
88 | |
89 /** | |
90 * | |
91 */ | |
92 public bool remove(Object o); | |
93 | |
94 /** | |
95 * @TrackedGetter | |
96 */ | |
97 public bool containsAll(Collection c); | |
98 | |
99 /** | |
100 * | |
101 */ | |
102 public bool addAll(Collection c); | |
103 | |
104 /** | |
105 * | |
106 */ | |
107 public bool addAll(int index, Collection c); | |
108 | |
109 /** | |
110 * | |
111 */ | |
112 public bool removeAll(Collection c); | |
113 | |
114 /** | |
115 * | |
116 */ | |
117 public bool retainAll(Collection c); | |
118 | |
119 /** | |
120 * @TrackedGetter | |
121 */ | |
122 public override equals_t opEquals(Object o); | |
123 | |
124 /** | |
125 * @TrackedGetter | |
126 */ | |
127 public override hash_t toHash(); | |
128 | |
129 /** | |
130 * @TrackedGetter | |
131 */ | |
132 public Object get(int index); | |
133 | |
134 /** | |
135 * | |
136 */ | |
137 public Object set(int index, Object element); | |
138 | |
139 /** | |
140 * Moves the element located at <code>oldIndex</code> to | |
141 * <code>newIndex</code>. This method is equivalent to calling | |
142 * <code>add(newIndex, remove(oldIndex))</code>. | |
143 * <p> | |
144 * Implementors should deliver list change notification for the remove and | |
145 * add operations in the same ListChangeEvent, as this allows | |
146 * {@link ListDiff#acceptcast(ListDiffVisitor)} to recognize the operation as a | |
147 * move. | |
148 * | |
149 * @param oldIndex | |
150 * the element's position before the move. Must be within the | |
151 * range <code>0 <= oldIndex < size()</code>. | |
152 * @param newIndex | |
153 * the element's position after the move. Must be within the | |
154 * range <code>0 <= newIndex < size()</code>. | |
155 * @return the element that was moved. | |
156 * @throws IndexOutOfBoundsException | |
157 * if either argument is out of range (<code>0 <= index < size()</code>). | |
158 * @see ListDiffVisitor#handleMove(int, int, Object) | |
159 * @see ListDiff#acceptcast(ListDiffVisitor) | |
160 * @since 1.1 | |
161 */ | |
162 public Object move(int oldIndex, int newIndex); | |
163 | |
164 /** | |
165 * | |
166 */ | |
167 public Object remove(int index); | |
168 | |
169 /** | |
170 * @TrackedGetter | |
171 */ | |
172 public int indexOf(Object o); | |
173 | |
174 /** | |
175 * @TrackedGetter | |
176 */ | |
177 public int lastIndexOf(Object o); | |
178 | |
179 /** | |
180 * @TrackedGetter | |
181 */ | |
182 public ListIterator listIterator(); | |
183 | |
184 /** | |
185 * @TrackedGetter | |
186 */ | |
187 public ListIterator listIterator(int index); | |
188 | |
189 /** | |
190 * @TrackedGetter | |
191 */ | |
192 public List subList(int fromIndex, int toIndex); | |
193 | |
194 /** | |
195 * @return the type of the elements or <code>null</code> if untyped | |
196 */ | |
197 Object getElementType(); | |
198 } |