org.quilt.graph
Class ComplexConnector

java.lang.Object
  |
  +--org.quilt.graph.Connector
        |
        +--org.quilt.graph.ComplexConnector

public class ComplexConnector
extends Connector

A Connector holding a single edge plus a fixed size array of edges. This is a combination of the UnaryConnector and MultiConnector.

Author:
Jim Dixon

Constructor Summary
ComplexConnector(Connector conn, int n)
           
ComplexConnector(Edge e, int n)
          Constructor for a Connector with a single edge plus a fixed-size array of edges.
 
Method Summary
 Edge getEdge()
          Get the single edge.
 Edge getEdge(int n)
          Get the Nth edge from the array.
 Vertex getTarget()
          Get the target of the single edge.
 Vertex getTarget(int n)
          Get the target of the Nth edge.
 void setTarget(Vertex v)
          Change the target of the single edge.
 void setTarget(Vertex v, int n)
          Change the target of the Nth edge.
 int size()
          Returns the number of edges in the connector EXCLUDING the preferred edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexConnector

public ComplexConnector(Edge e,
                        int n)
Constructor for a Connector with a single edge plus a fixed-size array of edges. The source of the single edge becomes the source of the array of edges. All edges in the array are set to point to the graph exit.

Parameters:
e - Becomes preferred edge of the connector.
n - Number of edges in the array

ComplexConnector

public ComplexConnector(Connector conn,
                        int n)
Method Detail

getEdge

public Edge getEdge()
Get the single edge.

Specified by:
getEdge in class Connector

getTarget

public Vertex getTarget()
Get the target of the single edge.

Specified by:
getTarget in class Connector

setTarget

public void setTarget(Vertex v)
Change the target of the single edge.

Specified by:
setTarget in class Connector

getEdge

public Edge getEdge(int n)
Get the Nth edge from the array.


getTarget

public Vertex getTarget(int n)
Get the target of the Nth edge.


setTarget

public void setTarget(Vertex v,
                      int n)
Change the target of the Nth edge.


size

public int size()
Returns the number of edges in the connector EXCLUDING the preferred edge. This is the same number used in the constructor as the size of the connector.

Specified by:
size in class Connector
Returns:
Total number of edges in the multiway part of the connector.


Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.