EntityIterator.java revision 9db3d07b9620b4269ab33f78604a36327e536ce1
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 21/** 22 * @hide 23 */ 24public interface EntityIterator { 25 /** 26 * Returns whether there are more elements to iterate, i.e. whether the 27 * iterator is positioned in front of an element. 28 * 29 * @return {@code true} if there are more elements, {@code false} otherwise. 30 * @see #next 31 * @since Android 1.0 32 */ 33 public boolean hasNext() throws RemoteException; 34 35 /** 36 * Returns the next object in the iteration, i.e. returns the element in 37 * front of the iterator and advances the iterator by one position. 38 * 39 * @return the next object. 40 * @throws java.util.NoSuchElementException 41 * if there are no more elements. 42 * @see #hasNext 43 * @since Android 1.0 44 */ 45 public Entity next() throws RemoteException; 46 47 public void reset() throws RemoteException; 48 49 /** 50 * Indicates that this iterator is no longer needed and that any associated resources 51 * may be released (such as a SQLite cursor). 52 */ 53 public void close(); 54} 55