Class ImmutableIterator<E>

java.lang.Object
org.djutils.immutablecollections.ImmutableIterator<E>
Type Parameters:
E - the element type
All Implemented Interfaces:
Iterator<E>

public class ImmutableIterator<E> extends Object implements Iterator<E>
An immutable iterator over elements, wrapping a "mutable" iterator. The default remove method from the interface will throw an exception.

Copyright (c) 2016-2024 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djutils.org. The DJUTILS project is distributed under a three-clause BSD-style license, which can be found at https://djutils.org/docs/license.html.

Author:
Alexander Verbraeck, Peter Knoppers
  • Constructor Details

    • ImmutableIterator

      public ImmutableIterator(Iterator<E> iterator)
      Parameters:
      iterator - Iterator<E>; the iterator to wrap as an immutable iterator.
  • Method Details