Package jadex.commons

Class IterableIteratorWrapper<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>

    public class IterableIteratorWrapper<T>
    extends java.lang.Object
    implements java.lang.Iterable<T>
    Needed because Java does not support enhanced for loop with Iterator elements :-( why? Only Iterable is supported.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Iterator<T> iter
      The iterator.
    • Constructor Summary

      Constructors 
      Constructor Description
      IterableIteratorWrapper​(java.util.Iterator<T> iter)
      Create a new wrapper.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<T> iterator()
      Get the iterator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • iter

        protected java.util.Iterator<T> iter
        The iterator.
    • Constructor Detail

      • IterableIteratorWrapper

        public IterableIteratorWrapper​(java.util.Iterator<T> iter)
        Create a new wrapper.
        Parameters:
        iter - The iterator.
    • Method Detail

      • iterator

        public java.util.Iterator<T> iterator()
        Get the iterator.
        Specified by:
        iterator in interface java.lang.Iterable<T>
        Returns:
        The iterator.