org.quilt.graph
Class MultiConnector

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

public class MultiConnector
extends Connector

A Connector holding a array of edges, where the array has at least one member. The first element of the array is preferred.

Author:
Jim Dixon

Constructor Summary
MultiConnector(Connector conn, int n)
          Constructor initialized from an existing UnaryConnector.
MultiConnector(Edge seed, int n)
          Constructor for fixed-size array of edges.
 
Method Summary
 Edge getEdge()
          Get the outgoing edge.
 Edge getEdge(int n)
           
 Vertex getTarget()
          Get the target of the preferred edge.
 Vertex getTarget(int n)
           
 void setTarget(Vertex v)
          Set the target of the connector's preferred edge.
 void setTarget(Vertex v, int n)
           
 int size()
          Returns total number of edges in the connector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiConnector

public MultiConnector(Edge seed,
                      int n)
Constructor for fixed-size array of edges. All edges in the new connector are copies of the seed edge.


MultiConnector

public MultiConnector(Connector conn,
                      int n)
Constructor initialized from an existing UnaryConnector. The unary connector is destroyed after constructing the new connector.

Method Detail

getEdge

public Edge getEdge()
Description copied from class: Connector
Get the outgoing edge. If this is not a UnaryConnector, this will be the preferred edge. What 'preferred' means depends upon the type of connector.

Specified by:
getEdge in class Connector

getTarget

public Vertex getTarget()
Description copied from class: Connector
Get the target of the preferred edge.

Specified by:
getTarget in class Connector

setTarget

public void setTarget(Vertex v)
Description copied from class: Connector
Set the target of the connector's preferred edge.

Specified by:
setTarget in class Connector

getEdge

public Edge getEdge(int n)

getTarget

public Vertex getTarget(int n)

setTarget

public void setTarget(Vertex v,
                      int n)

size

public int size()
Description copied from class: Connector
Returns total number of edges in the connector.

Specified by:
size in class Connector
Returns:
The number of edges in the Connector.


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