[Home] DMelt member access. Java source code: org.jgrapht.traverse.DepthFirstIterator
/*
* (C) Copyright 2003-2017, by Liviu Rau and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* This program and the accompanying materials are dual-licensed under
* either
*
* (a) the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation, or (at your option) any
* later version.
*
* or (per the licensee's choosing)
*
* (b) the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation.
*/
package org.jgrapht.traverse;
import java.util.*;
import org.jgrapht.*;
import org.jgrapht.util.*;
/**
* A depth-first iterator for a directed and an undirected graph. For this iterator to work
* correctly the graph must not be modified during iteration. Currently there are no means to ensure
* that, nor to fail-fast. The results of such modifications are undefined.
*
* @param the graph vertex type
* @param the graph edge type
*
* @author Liviu Rau
* @author Barak Naveh
* @since Jul 29, 2003
*/
public class DepthFirstIterator
extends CrossComponentIterator
{
/**
* Sentinel object. Unfortunately, we can't use null, because ArrayDeque won't accept those. And
* we don't want to rely on the caller to provide a sentinel object for us. So we have to play
* typecasting games.
*/
public static final Object SENTINEL = new Object();
/**
* @see #getStack
*/
private Deque