001 /*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.commons.collections.primitives;
018
019 /**
020 * An iterator over <code>boolean</code> values.
021 *
022 * @see org.apache.commons.collections.primitives.adapters.BooleanIteratorIterator
023 * @see org.apache.commons.collections.primitives.adapters.IteratorBooleanIterator
024 *
025 * @since Commons Primitives 1.1
026 * @version $Revision: 480460 $ $Date: 2006-11-29 09:14:21 +0100 (Wed, 29 Nov 2006) $
027 */
028 public interface BooleanIterator {
029 /**
030 * Returns <code>true</code> iff I have more elements. (In other words,
031 * returns <code>true</code> iff a subsequent call to {@link #next next}
032 * will return an element rather than throwing an exception.)
033 *
034 * @return <code>true</code> iff I have more elements
035 */
036 boolean hasNext();
037
038 /**
039 * Returns the next element in me.
040 *
041 * @return the next element in me
042 * @throws java.util.NoSuchElementException if there is no next element
043 */
044 boolean next();
045
046 /**
047 * Removes from my underlying collection the last element {@link #next
048 * returned} by me (optional operation).
049 *
050 * @throws UnsupportedOperationException if this operation is not supported
051 * @throws IllegalStateException if {@link #next} has not yet been called,
052 * or {@link #remove} has already been called since the last call
053 * to {@link #next}.
054 */
055 void remove();
056 }