001/* 002 * Copyright 2001-2010 Stephen Colebourne 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.joda.primitives.iterator; 017 018import java.util.Iterator; 019 020/** 021 * Base interface for all primitive iterator interfaces. 022 * 023 * @author Stephen Colebourne 024 * @since 1.0 025 */ 026public interface PrimitiveIterator<E> extends Iterator<E> { 027 028 // Mandatory operations 029 //----------------------------------------------------------------------- 030 /** 031 * Checks whether the iterator can currently be modified. 032 * 033 * @return <code>true</code> if the modification methods of the iterator can be used 034 */ 035 boolean isModifiable(); 036 037 /** 038 * Checks whether the iterator can be reset. 039 * 040 * @return <code>true</code> if the object can be reset 041 */ 042 boolean isResettable(); 043 044 // Optional operations 045 //----------------------------------------------------------------------- 046 /** 047 * Resets the iterator back to its initial state (optional operation). 048 * 049 * @throws UnsupportedOperationException if the iterator cannot be reset 050 */ 051 void reset(); 052 053}