Class DepthFirstExpandCollection<N>

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Stack<N> stack  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(java.util.Collection<? extends N> newElements)
      Adds the given elements to the collection.
      boolean isEmpty()
      Checks whether or not the collection retained by this ExpandCollection is empty.
      N pop()
      Gets and removes the first element to be expanded by the node expander.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • stack

        protected java.util.Stack<N> stack
    • Constructor Detail

      • DepthFirstExpandCollection

        public DepthFirstExpandCollection()
    • Method Detail

      • add

        public void add​(java.util.Collection<? extends N> newElements)
        Description copied from interface: ExpandCollection
        Adds the given elements to the collection. Note that implementing classes may safely assume that the calling thread owns the monitor, i.e. there is no need to synchronize on the collection retained by this expandcollection and removals are allowed. Furthermore, the implementing class may decide not to include any of the given newElements if it decides that they are not to be investigated further.
        Specified by:
        add in interface ExpandCollection<N>
        Parameters:
        newElements - the nodes to expand further
      • pop

        public N pop()
        Description copied from interface: ExpandCollection
        Gets and removes the first element to be expanded by the node expander. Implementing classes may assume that isEmpty() returns false before any call to pop, i.e. the first line of the implementation can be: assert (!isEmpty())
        Specified by:
        pop in interface ExpandCollection<N>
        Returns:
        the first element to be investigated by the searcher.
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: ExpandCollection
        Checks whether or not the collection retained by this ExpandCollection is empty. If this method returns false, a call to pop() can be made.
        Specified by:
        isEmpty in interface ExpandCollection<N>
        Returns: