Class NodeIterable<Item>

  • Type Parameters:
    Item -
    All Implemented Interfaces:
    java.lang.Iterable<Item>

    public class NodeIterable<Item>
    extends java.lang.Object
    implements java.lang.Iterable<Item>
    NodeIterable class
    • Constructor Summary

      Constructors 
      Constructor Description
      NodeIterable()
      Initializes an empty bag.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Item item)
      Adds the item to this bag.
      boolean isEmpty()
      Returns true if this bag is empty.
      java.util.Iterator<Item> iterator()
      Returns an iterator that iterates over the items in this bag in arbitrary order.
      int size()
      Returns the number of items in this bag.
      • 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
    • Constructor Detail

      • NodeIterable

        public NodeIterable()
        Initializes an empty bag.
    • Method Detail

      • isEmpty

        public boolean isEmpty()
        Returns true if this bag is empty.
        Returns:
        true if this bag is empty; false otherwise
      • size

        public int size()
        Returns the number of items in this bag.
        Returns:
        the number of items in this bag
      • add

        public void add​(Item item)
        Adds the item to this bag.
        Parameters:
        item - the item to add to this bag
      • iterator

        public java.util.Iterator<Item> iterator()
        Returns an iterator that iterates over the items in this bag in arbitrary order.
        Specified by:
        iterator in interface java.lang.Iterable<Item>
        Returns:
        an iterator that iterates over the items in this bag in arbitrary order