Class GraphProducer<T>

java.lang.Object
com.graphs.utils.graph.GraphProducer<T>
Type Parameters:
T - the bounding type stored in given graphs.

public class GraphProducer<T> extends Object
This utility class produce instances of Graph.
Since:
2.0
Version:
JDK 1.7
Author:
Ɓukasz Malara
  • Field Details

  • Constructor Details

    • GraphProducer

      public GraphProducer()
  • Method Details

    • newGraphFromFile

      public Optional<Graph<T>> newGraphFromFile(String file) throws NegativeVertexIndexException
      This method returns an optional graph based on a structure defined in a file given as a parameter.
      Parameters:
      file - name of a file containing graph structure definition.
      Returns:
      optional of graph
      Throws:
      NegativeVertexIndexException - if file contains negative number(s).
      Since:
      1.0
    • newEmptyGraph

      public Graph<T> newEmptyGraph()
      This method returns an empty graph and prints feedback message.
      Returns:
      empty graph
      Since:
      1.0
    • newCompleteGraph

      public Graph<T> newCompleteGraph(int startIndex, int size)
      This method returns a complete graph and prints feedback message.
      Parameters:
      startIndex - least index of vertex in returned graph
      size - size of returned graph
      Returns:
      complete graph
      Since:
      1.0