Class CompleteGraphGenerator<U>

java.lang.Object
es.uam.eps.ir.relison.graph.generator.CompleteGraphGenerator<U>
Type Parameters:
U - Type of the users
All Implemented Interfaces:
GraphGenerator<U>

public class CompleteGraphGenerator<U>
extends java.lang.Object
implements GraphGenerator<U>
Class for generating complete graphs.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private boolean configured
    True if the graph has already been configured, false if not.
    private boolean directed
    Indicates if the generated graphs are directed or undirected.
    private Generator<U> generator
    User generator.
    private int numNodes
    Number of nodes of the generated graphs.
    private boolean selfloops
    Indicates if autoloops are also allowed.
  • Constructor Summary

    Constructors 
    Constructor Description
    CompleteGraphGenerator()  
  • Method Summary

    Modifier and Type Method Description
    void configure​(boolean directed, int numNodes, boolean autoloops, Generator<U> generator)
    Configures the graph.
    void configure​(boolean directed, int numNodes, Generator<U> generator)
    Configures the graph.
    void configure​(java.lang.Object... configuration)
    Configures the generator.
    Graph<U> generate()
    Generates a graph.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • numNodes

      private int numNodes
      Number of nodes of the generated graphs.
    • generator

      private Generator<U> generator
      User generator.
    • directed

      private boolean directed
      Indicates if the generated graphs are directed or undirected.
    • selfloops

      private boolean selfloops
      Indicates if autoloops are also allowed.
    • configured

      private boolean configured
      True if the graph has already been configured, false if not.
  • Constructor Details

  • Method Details

    • configure

      public void configure​(java.lang.Object... configuration)
      Description copied from interface: GraphGenerator
      Configures the generator.
      Specified by:
      configure in interface GraphGenerator<U>
      Parameters:
      configuration - An array containing the configuration parameters.
    • configure

      public void configure​(boolean directed, int numNodes, Generator<U> generator)
      Configures the graph.
      Parameters:
      directed - Indicates if the node is directed or not.
      numNodes - Number of nodes of the graph.
      generator - Object that automatically creates the indicated number of nodes.
    • configure

      public void configure​(boolean directed, int numNodes, boolean autoloops, Generator<U> generator)
      Configures the graph.
      Parameters:
      directed - Indicates if the node is directed or not.
      numNodes - Number of nodes of the graph.
      autoloops - Indicates if the graph allows autoloops or not.
      generator - Object that automatically creates the indicated number of nodes.
    • generate

      public Graph<U> generate() throws GeneratorNotConfiguredException
      Description copied from interface: GraphGenerator
      Generates a graph.
      Specified by:
      generate in interface GraphGenerator<U>
      Returns:
      the generated graph.
      Throws:
      GeneratorNotConfiguredException - The generator is not configured.