edu.uci.ics.jung.utils
Class TypedVertexGenerator

java.lang.Object
  extended by edu.uci.ics.jung.utils.TypedVertexGenerator
All Implemented Interfaces:
VertexGenerator

public class TypedVertexGenerator
extends Object
implements VertexGenerator

Generates vertices according to the edge requirements submitted to the constructor. This implementation respects edge direction (directed, undirected, mixed) as well as edge multiplicity (parallel edges). See the constructor for a list of the vertex types.

Author:
Joshua O'Madadhain

Field Summary
protected static Object DIRECTED
           
protected static Object MIXED
           
protected  boolean simple
          if true, generated vertices won't support parallel edges
protected  Object type
           
protected static Object UNDIRECTED
           
 
Fields inherited from interface edu.uci.ics.jung.utils.VertexGenerator
TAG
 
Constructor Summary
TypedVertexGenerator(ArchetypeGraph g)
           
TypedVertexGenerator(Collection edge_requirements)
          Determines the type of vertices that this generator will create, according to the edge requirements specified in the constructor:
  • undirected, no parallel edges - creates @link{SimpleUndirectedSparseVertex}
  • directed, no parallel edges - creates @link{SimpleDirectedSparseVertex}
  • mixed (directed and undirected), no parallel edges - creates @link{SimpleSparseVertex}
  • undirected, parallel edges allowed - creates @link{UndirectedSparseVertex}
  • directed, parallel edges allowed - creates @link{DirectedSparseVertex}
  • mixed, parallel edges allowed - creates @link{SparseVertex}
  •  
    Method Summary
     Vertex create()
              Creates a vertex whose type is determined by the requirements specified in the constructor.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    type

    protected Object type

    simple

    protected boolean simple
    if true, generated vertices won't support parallel edges


    UNDIRECTED

    protected static final Object UNDIRECTED

    DIRECTED

    protected static final Object DIRECTED

    MIXED

    protected static final Object MIXED
    Constructor Detail

    TypedVertexGenerator

    public TypedVertexGenerator(Collection edge_requirements)
    Determines the type of vertices that this generator will create, according to the edge requirements specified in the constructor:
    1. undirected, no parallel edges - creates @link{SimpleUndirectedSparseVertex}
    2. directed, no parallel edges - creates @link{SimpleDirectedSparseVertex}
    3. mixed (directed and undirected), no parallel edges - creates @link{SimpleSparseVertex}
    4. undirected, parallel edges allowed - creates @link{UndirectedSparseVertex}
    5. directed, parallel edges allowed - creates @link{DirectedSparseVertex}
    6. mixed, parallel edges allowed - creates @link{SparseVertex}


    TypedVertexGenerator

    public TypedVertexGenerator(ArchetypeGraph g)
    Method Detail

    create

    public Vertex create()
    Creates a vertex whose type is determined by the requirements specified in the constructor.

    Specified by:
    create in interface VertexGenerator
    See Also:
    VertexGenerator.create()