File: _E_Collection.template

package info (click to toggle)
trove3 3.0.3-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,924 kB
  • sloc: java: 16,429; xml: 331; makefile: 21; sh: 10
file content (317 lines) | stat: -rw-r--r-- 11,013 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
///////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2001, Eric D. Friedman All Rights Reserved.
// Copyright (c) 2009, Rob Eden All Rights Reserved.
// Copyright (c) 2009, Jeff Randall All Rights Reserved.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
///////////////////////////////////////////////////////////////////////////////

package gnu.trove;


//////////////////////////////////////////////////
// THIS IS A GENERATED CLASS. DO NOT HAND EDIT! //
//////////////////////////////////////////////////

import gnu.trove.iterator.T#E#Iterator;
import gnu.trove.procedure.T#E#Procedure;

import java.util.Collection;
import java.io.Serializable;

/**
 * An interface that mimics the <tt>Collection</tt> interface.
 *
 * @author Eric D. Friedman
 * @author Rob Eden
 * @author Jeff Randall
 * @version $Id: _E_Collection.template,v 1.1.2.2 2009/09/15 02:38:30 upholderoftruth Exp $
 */

public interface T#E#Collection {
	static final long serialVersionUID = 1L;

    /**
     * Returns the value that is used to represent null. The default
     * value is generally zero, but can be changed during construction
     * of the collection.
     *
     * @return the value that represents null
     */
    #e# getNoEntryValue();


    /**
     * Returns the number of elements in this collection (its cardinality).  If this
     * collection contains more than <tt>Integer.MAX_VALUE</tt> elements, returns
     * <tt>Integer.MAX_VALUE</tt>.
     *
     * @return the number of elements in this collection (its cardinality)
     */
    int size();


    /**
     * Returns <tt>true</tt> if this collection contains no elements.
     *
     * @return <tt>true</tt> if this collection contains no elements
     */
    boolean isEmpty();


    /**
     * Returns <tt>true</tt> if this collection contains the specified element.
     *
     * @param entry an <code>#e#</code> value
     * @return true if the collection contains the specified element.
     */
    boolean contains( #e# entry );


    /**
     * Creates an iterator over the values of the collection.  The iterator
     * supports element deletion.
     *
     * @return an <code>T#E#Iterator</code> value
     */
    T#E#Iterator iterator();


    /**
     * Returns an array containing all of the elements in this collection.
     * If this collection makes any guarantees as to what order its elements
     * are returned by its iterator, this method must return the
     * elements in the same order.
     *
     * <p>The returned array will be "safe" in that no references to it
     * are maintained by this collection.  (In other words, this method must
     * allocate a new array even if this collection is backed by an array).
     * The caller is thus free to modify the returned array.
     *
     * <p>This method acts as bridge between array-based and collection-based
     * APIs.
     *
     * @return an array containing all the elements in this collection
     */
    #e#[] toArray();


    /**
     * Returns an array containing elements in this collection.
     *
     * <p>If this collection fits in the specified array with room to spare
     * (i.e., the array has more elements than this collection), the element in
     * the array immediately following the end of the collection is collection to
     * <tt>{@link #getNoEntryValue()}</tt>.  (This is useful in determining
     * the length of this collection <i>only</i> if the caller knows that this
     * collection does not contain any elements representing null.)
     *
     * <p>If the native array is smaller than the collection size,
     * the array will be filled with elements in Iterator order
     * until it is full and exclude the remainder.
     *
     * <p>If this collection makes any guarantees as to what order its elements
     * are returned by its iterator, this method must return the elements
     * in the same order.
     *
     * @param dest the array into which the elements of this collection are to be
     *        stored.
     * @return an <tt>#e#[]</tt> containing all the elements in this collection
     * @throws NullPointerException if the specified array is null
     */
    #e#[] toArray( #e#[] dest );


    /**
     * Inserts a value into the collection.
     *
     * @param entry a <code>#e#</code> value
     * @return true if the collection was modified by the add operation
     */
    boolean add( #e# entry );


    /**
     * Removes <tt>entry</tt> from the collection.
     *
     * @param entry an <code>#e#</code> value
     * @return true if the collection was modified by the remove operation.
     */
    boolean remove( #e# entry );


    /**
     * Tests the collection to determine if all of the elements in
     * <tt>collection</tt> are present.
     *
     * @param collection a <code>Collection</code> value
     * @return true if all elements were present in the collection.
     */
    boolean containsAll( Collection<?> collection );


    /**
     * Tests the collection to determine if all of the elements in
     * <tt>T#E#Collection</tt> are present.
     *
     * @param collection a <code>T#E#Collection</code> value
     * @return true if all elements were present in the collection.
     */
    boolean containsAll( T#E#Collection collection );


    /**
     * Tests the collection to determine if all of the elements in
     * <tt>array</tt> are present.
     *
     * @param array as <code>array</code> of #e# primitives.
     * @return true if all elements were present in the collection.
     */
    boolean containsAll( #e#[] array );


    /**
     * Adds all of the elements in <tt>collection</tt> to the collection.
     *
     * @param collection a <code>Collection</code> value
     * @return true if the collection was modified by the add all operation.
     */
    boolean addAll( Collection<? extends #ET#> collection );


    /**
     * Adds all of the elements in the <tt>T#E#Collection</tt> to the collection.
     *
     * @param collection a <code>T#E#Collection</code> value
     * @return true if the collection was modified by the add all operation.
     */
    boolean addAll( T#E#Collection collection );


    /**
     * Adds all of the elements in the <tt>array</tt> to the collection.
     *
     * @param array a <code>array</code> of #e# primitives.
     * @return true if the collection was modified by the add all operation.
     */
    boolean addAll( #e#[] array );


    /**
     * Removes any values in the collection which are not contained in
     * <tt>collection</tt>.
     *
     * @param collection a <code>Collection</code> value
     * @return true if the collection was modified by the retain all operation
     */
    boolean retainAll( Collection<?> collection );


    /**
     * Removes any values in the collection which are not contained in
     * <tt>T#E#Collection</tt>.
     *
     * @param collection a <code>T#E#Collection</code> value
     * @return true if the collection was modified by the retain all operation
     */
    boolean retainAll( T#E#Collection collection );


    /**
     * Removes any values in the collection which are not contained in
     * <tt>array</tt>.
     *
     * @param array an <code>array</code> of #e# primitives.
     * @return true if the collection was modified by the retain all operation
     */
    boolean retainAll( #e#[] array );


    /**
     * Removes all of the elements in <tt>collection</tt> from the collection.
     *
     * @param collection a <code>Collection</code> value
     * @return true if the collection was modified by the remove all operation.
     */
    boolean removeAll( Collection<?> collection );


    /**
     * Removes all of the elements in <tt>T#E#Collection</tt> from the collection.
     *
     * @param collection a <code>T#E#Collection</code> value
     * @return true if the collection was modified by the remove all operation.
     */
    boolean removeAll( T#E#Collection collection );


    /**
     * Removes all of the elements in <tt>array</tt> from the collection.
     *
     * @param array an <code>array</code> of #e# primitives.
     * @return true if the collection was modified by the remove all operation.
     */
    boolean removeAll( #e#[] array );


    /**
     * Empties the collection.
     */
    void clear();


    /**
     * Executes <tt>procedure</tt> for each element in the collection.
     *
     * @param procedure a <code>T#E#Procedure</code> value
     * @return false if the loop over the collection terminated because
     * the procedure returned false for some value.
     */
    boolean forEach( T#E#Procedure procedure );


    // Comparison and hashing

    /**
     * Compares the specified object with this collection for equality.  Returns
     * <tt>true</tt> if the specified object is also a collection, the two collection
     * have the same size, and every member of the specified collection is
     * contained in this collection (or equivalently, every member of this collection is
     * contained in the specified collection).  This definition ensures that the
     * equals method works properly across different implementations of the
     * collection interface.
     *
     * @param o object to be compared for equality with this collection
     * @return <tt>true</tt> if the specified object is equal to this collection
     */
    boolean equals( Object o );


    /**
     * Returns the hash code value for this collection.  The hash code of a collection is
     * defined to be the sum of the hash codes of the elements in the collection.
     * This ensures that <tt>s1.equals(s2)</tt> implies that
     * <tt>s1.hashCode()==s2.hashCode()</tt> for any two collection <tt>s1</tt>
     * and <tt>s2</tt>, as required by the general contract of
     * {@link Object#hashCode}.
     *
     * @return the hash code value for this collection
     * @see Object#equals(Object)
     * @see Collection#equals(Object)
     */
    int hashCode();


} // T#E#Collection