Class NamedObj.ContainedObjectsIterator

  • All Implemented Interfaces:
    java.util.Iterator
    Direct Known Subclasses:
    Entity.ContainedObjectsIterator
    Enclosing class:
    NamedObj

    protected class NamedObj.ContainedObjectsIterator
    extends java.lang.Object
    implements java.util.Iterator
    This class is an iterator over all the contained objects (all instances of NamedObj). In this base class, the contained objects are attributes. In derived classes, they include ports, relations, and entities as well.
    • Constructor Summary

      Constructors 
      Constructor Description
      ContainedObjectsIterator()
      Create an iterator over all the contained objects.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Return true if the iteration has more elements.
      java.lang.Object next()
      Return the next element in the iteration.
      void remove()
      Throw a UnsupportedOperationException because remove() is not supported.
      • Methods inherited from class java.lang.Object

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

        forEachRemaining
    • Constructor Detail

      • ContainedObjectsIterator

        public ContainedObjectsIterator()
        Create an iterator over all the contained objects.
    • Method Detail

      • hasNext

        public boolean hasNext()
        Return true if the iteration has more elements. In this base class, this returns true if there are more attributes.
        Specified by:
        hasNext in interface java.util.Iterator
        Returns:
        True if there are more attributes.
      • next

        public java.lang.Object next()
        Return the next element in the iteration. In this base class, this is the next attribute.
        Specified by:
        next in interface java.util.Iterator
        Returns:
        The next attribute.
      • remove

        public void remove()
        Throw a UnsupportedOperationException because remove() is not supported. The reason is because this iterator calls attributeList().iterator(), which returns a NamedList that is unmodifiable.
        Specified by:
        remove in interface java.util.Iterator