EntityIterator.java revision 6a8d5332f00bdfade6674b312e7166940aa28348
1/*
2 * Copyright (C) 2009 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.content;
18
19import android.os.RemoteException;
20
21public interface  EntityIterator {
22    /**
23     * Returns whether there are more elements to iterate, i.e. whether the
24     * iterator is positioned in front of an element.
25     *
26     * @return {@code true} if there are more elements, {@code false} otherwise.
27     * @see #next
28     * @since Android 1.0
29     */
30    public boolean hasNext() throws RemoteException;
31
32    /**
33     * Returns the next object in the iteration, i.e. returns the element in
34     * front of the iterator and advances the iterator by one position.
35     *
36     * @return the next object.
37     * @throws java.util.NoSuchElementException
38     *             if there are no more elements.
39     * @see #hasNext
40     * @since Android 1.0
41     */
42    public Entity next() throws RemoteException;
43
44    /**
45     * Indicates that this iterator is no longer needed and that any associated resources
46     * may be released (such as a SQLite cursor).
47     */
48    public void close();
49}
50