Algorithm
Development Kit 1.0

algs.model.network
Class VertexStructure

java.lang.Object
  extended by algs.model.network.VertexStructure

public class VertexStructure
extends java.lang.Object

Records information about a vertex's forward (Outgoing) edges and backward (Incoming) edges.

Author:
George Heineman

Constructor Summary
VertexStructure()
           
 
Method Summary
 void addBackward(EdgeInfo ei)
          Add the given edge into the list of backward edges.
 void addForward(EdgeInfo ei)
          Add the given edge into the list of forward edges.
 java.util.Iterator<EdgeInfo> backward()
          Return iterator over backward edges.
static VertexStructure[] construct(int numVertices)
          Construct an array of VertexStructure objects, where each element is pre-initialized to a new VertexStructure.
 java.util.Iterator<EdgeInfo> forward()
          Return iterator over forward edges.
 java.lang.String toString()
          Useful for debugging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VertexStructure

public VertexStructure()
Method Detail

construct

public static VertexStructure[] construct(int numVertices)
Construct an array of VertexStructure objects, where each element is pre-initialized to a new VertexStructure.

Parameters:
numVertices - the size of the network problem

forward

public java.util.Iterator<EdgeInfo> forward()
Return iterator over forward edges.


backward

public java.util.Iterator<EdgeInfo> backward()
Return iterator over backward edges.


addForward

public void addForward(EdgeInfo ei)
Add the given edge into the list of forward edges.

Parameters:
ei - The designated edge with capacity information.

addBackward

public void addBackward(EdgeInfo ei)
Add the given edge into the list of backward edges.

Parameters:
ei - The designated edge with capacity information.

toString

public java.lang.String toString()
Useful for debugging.

Overrides:
toString in class java.lang.Object

Algorithm Development Kit 1.0

This code supports the Algorithms in a Nutshell book, published by O'Reilly Media, Inc. in November 2008. Please visit the book web page to learn of any changes to the code repository or to record a potential defect.