KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgrapht > traverse > GraphIterator


1 /* ==========================================
2  * JGraphT : a free Java graph-theory library
3  * ==========================================
4  *
5  * Project Info: http://jgrapht.sourceforge.net/
6  * Project Creator: Barak Naveh (barak_naveh@users.sourceforge.net)
7  *
8  * (C) Copyright 2003-2006, by Barak Naveh and Contributors.
9  *
10  * This library is free software; you can redistribute it and/or modify it
11  * under the terms of the GNU Lesser General Public License as published by
12  * the Free Software Foundation; either version 2.1 of the License, or
13  * (at your option) any later version.
14  *
15  * This library is distributed in the hope that it will be useful, but
16  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
17  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this library; if not, write to the Free Software Foundation,
22  * Inc.,
23  * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
24  */

25 /* ------------------
26  * GraphIterator.java
27  * ------------------
28  * (C) Copyright 2003-2006, by Barak Naveh and Contributors.
29  *
30  * Original Author: Barak Naveh
31  * Contributor(s): Christian Hammer
32  *
33  * $Id: GraphIterator.java 504 2006-07-03 02:37:26Z perfecthash $
34  *
35  * Changes
36  * -------
37  * 31-Jul-2003 : Initial revision (BN);
38  * 11-Aug-2003 : Adaptation to new event model (BN);
39  * 04-May-2004 : Made generic (CH)
40  *
41  */

42 package org.jgrapht.traverse;
43
44 import java.util.*;
45
46 import org.jgrapht.event.*;
47
48
49 /**
50  * A graph iterator.
51  *
52  * @author Barak Naveh
53  * @since Jul 31, 2003
54  */

55 public interface GraphIterator<V, E>
56     extends Iterator<V>
57 {
58
59     //~ Methods ---------------------------------------------------------------
60

61     /**
62      * Test whether this iterator is set to traverse the grpah across connected
63      * components.
64      *
65      * @return <code>true</code> if traverses across connected components,
66      * otherwise <code>false</code>.
67      */

68     public boolean isCrossComponentTraversal();
69
70     /**
71      * Sets a value the <code>reuseEvents</code> flag. If the <code>
72      * reuseEvents</code> flag is set to <code>true</code> this class will reuse
73      * previously fired events and will not create a new object for each event.
74      * This option increases performance but should be used with care,
75      * especially in multithreaded environment.
76      *
77      * @param reuseEvents whether to reuse previously fired event objects
78      * instead of creating a new event object for each event.
79      */

80     public void setReuseEvents(boolean reuseEvents);
81
82     /**
83      * Tests whether the <code>reuseEvents</code> flag is set. If the flag is
84      * set to <code>true</code> this class will reuse previously fired events
85      * and will not create a new object for each event. This option increases
86      * performance but should be used with care, especially in multithreaded
87      * environment.
88      *
89      * @return the value of the <code>reuseEvents</code> flag.
90      */

91     public boolean isReuseEvents();
92
93     /**
94      * Adds the specified traversal listener to this iterator.
95      *
96      * @param l the traversal listener to be added.
97      */

98     public void addTraversalListener(TraversalListener<V, E> l);
99
100     /**
101      * Unsupported.
102      *
103      * @throws UnsupportedOperationException
104      */

105     public void remove();
106
107     /**
108      * Removes the specified traversal listener from this iterator.
109      *
110      * @param l the traversal listener to be removed.
111      */

112     public void removeTraversalListener(TraversalListener<V, E> l);
113 }
114
Popular Tags