View Javadoc

1   /*
2    *  Copyright 2001-2010 Stephen Colebourne
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  package org.joda.primitives.iterator;
17  
18  import java.util.Iterator;
19  
20  /**
21   * Base interface for all primitive iterator interfaces.
22   * 
23   * @author Stephen Colebourne
24   * @since 1.0
25   */
26  public interface PrimitiveIterator<E> extends Iterator<E> {
27  
28      // Mandatory operations
29      //-----------------------------------------------------------------------
30      /**
31       * Checks whether the iterator can currently be modified.
32       *
33       * @return <code>true</code> if the modification methods of the iterator can be used
34       */
35      boolean isModifiable();
36  
37      /**
38       * Checks whether the iterator can be reset.
39       *
40       * @return <code>true</code> if the object can be reset
41       */
42      boolean isResettable();
43  
44      // Optional operations
45      //-----------------------------------------------------------------------
46      /**
47       * Resets the iterator back to its initial state (optional operation).
48       * 
49       * @throws UnsupportedOperationException if the iterator cannot be reset
50       */
51      void reset();
52  
53  }