Class FileSourceLGL

All Implemented Interfaces:
FileSource, Source

public class FileSourceLGL
extends FileSourceBase
Reader for the "LGL" graph format.

The LGL graph format is a simple format where each line beginning by a sharp sign "#" describes a source vertex, and each subsequent line not beginning by a sharp sign describe an edge target for this source.

Also, the format does not specify any direction for edges. By default all edges are undirected.

This format only contains edges. To ensure the "add node" events are sent before an edge referencing two nodes is created via an "add edge" event, this reader has a hash set of already encountered nodes. The hash set allows to issue "add node" events only when a node is encountered for the first time.

This hash set consumes memory, but is the only way to ensure "add node" events are correctly issued. If this input is directly connected to a graph, as graphs can create non-existing nodes automatically, you can disable the hash set of nodes using the constructor FileSourceLGL(boolean), and giving "false" for the first argument.

The usual file name extension for this format is ".lgl".