Class IList.IListableFromCollection<E>

java.lang.Object
org.magicwerk.brownies.collections.IList.IListableFromCollection<E>
All Implemented Interfaces:
IListable<E>
Enclosing class:
IList<E>

protected static class IList.IListableFromCollection<E> extends Object implements IListable<E>
Wrapper to treat a Collection as IListable.

Note that the implementation relies on the fact that the elements are only accessed sequentially.

  • Field Details

    • iter

      Iterator<? extends E> iter
    • size

      int size
  • Constructor Details

    • IListableFromCollection

      IListableFromCollection(Collection<? extends E> coll)
  • Method Details

    • size

      public int size()
      Description copied from interface: IListable
      Return size of list
      Specified by:
      size in interface IListable<E>
    • get

      public E get(int index)
      Description copied from interface: IListable
      Return element at specified position
      Specified by:
      get in interface IListable<E>