soc.util
Class NodeLenVis<T>

java.lang.Object
  extended by soc.util.NodeLenVis<T>

public class NodeLenVis<T>
extends java.lang.Object

State object for iteratively tracing longest road: A node, path length so far, visited nodes, and optionally the road or ship that led to this node.

Author:
Robert S Thomas <thomas@infolab.northwestern.edu>

Field Summary
 SOCRoad inboundRoad
          the road or ship that lead us to this node, if len > 0 and SOCGame.hasSeaBoard.
 int len
          the current length of the path we're going down
 int node
          the coordinates of a node
 java.util.Vector<T> vis
          nodes that we have visited along the way
 
Constructor Summary
NodeLenVis(int n, int l, java.util.Vector<T> v)
          Creates a new NodeLenVis object.
NodeLenVis(int n, int l, java.util.Vector<T> v, SOCRoad rs)
          Creates a new NodeLenVis object.
 
Method Summary
 java.lang.String toString()
          Get a string representation of this NodeLenVis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

node

public int node
the coordinates of a node


len

public int len
the current length of the path we're going down


vis

public java.util.Vector<T> vis
nodes that we have visited along the way


inboundRoad

public SOCRoad inboundRoad
the road or ship that lead us to this node, if len > 0 and SOCGame.hasSeaBoard. If len == 0, inboundRoad is null because we're just starting the segment.

Since:
2.0.00
Constructor Detail

NodeLenVis

public NodeLenVis(int n,
                  int l,
                  java.util.Vector<T> v)
Creates a new NodeLenVis object.

Parameters:
n - Node coordinate
l - Length so far
v - Vector of nodes visited so far, as Integers

NodeLenVis

public NodeLenVis(int n,
                  int l,
                  java.util.Vector<T> v,
                  SOCRoad rs)
Creates a new NodeLenVis object.

Parameters:
n - Node coordinate
l - Length so far
v - Vector of nodes visited so far, as Integers
rs - Road or ship that led to this node, if l > 0; only needed if SOCGame.hasSeaBoard
Since:
2.0.00
Method Detail

toString

public java.lang.String toString()
Get a string representation of this NodeLenVis. The inbound road or ship, if any, is not included.

Overrides:
toString in class java.lang.Object
Returns:
A string in the form of: NodeLenVis:n=node|l=len|vis=vis