- creating a separate visitor package to organize the code a little
better. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/sandbox/graph/trunk@144579 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
bb5d76e618
commit
2a14dba733
15 files changed
+77
-27
No files matched your search
@@ -57,19 +57,19 @@ package org.apache.commons.graph;
|
||||
/**
|
||||
* Implements a simple first-in, last-out stack of vertices of fixed size.
|
||||
*
|
||||
* @version $Id: VStack.java,v 1.1 2001/11/12 16:05:20 jvanzyl Exp $
|
||||
* @version $Id: VStack.java,v 1.2 2001/11/29 14:17:33 jvanzyl Exp $
|
||||
* @author <A HREF="http://www.inf.fu-berlin.de/~dahm">M. Dahm</A>
|
||||
*/
|
||||
final class VStack {
|
||||
public final class VStack {
|
||||
private Vertex[] vertices;
|
||||
private int top;
|
||||
|
||||
VStack(int s) {
|
||||
public VStack(int s) {
|
||||
vertices = new Vertex[s];
|
||||
}
|
||||
|
||||
final void push(Vertex v) { vertices[top++] = v; }
|
||||
final Vertex pop() { return vertices[--top]; }
|
||||
final Vertex top() { return vertices[top - 1]; }
|
||||
final boolean empty() { return top <= 0; }
|
||||
public final void push(Vertex v) { vertices[top++] = v; }
|
||||
public final Vertex pop() { return vertices[--top]; }
|
||||
public final Vertex top() { return vertices[top - 1]; }
|
||||
public final boolean empty() { return top <= 0; }
|
||||
}
|
||||
Reference in new issue
Block a user