Graph.LabelFetcher

Convenience class to return the set of labels associated with a given graph edge. Note that due to snapping, one graph edge may correspond to several different input edges and will have all of their labels. This class is the preferred way to retrieve edge labels.

The reason this is a class rather than a graph method is because for undirected edges, we need to fetch the labels associated with both siblings. This is because only the original edge of the sibling pair has labels; the automatically generated sibling edge does not.

Constructors

this
this(Graph g, EdgeType edge_type)

Prepares to fetch labels associated with the given edge type. For EdgeType::UNDIRECTED, labels associated with both edges of the sibling pair will be returned. "edge_type" is a parameter (rather than using g.options().edge_type()) so that clients can explicitly control whether labels from one or both siblings are returned.

Members

Functions

fetch
void fetch(EdgeId e, S2Builder.Label[] labels)

Returns the set of labels associated with edge "e" (and also the labels associated with the sibling of "e" if edge_type() is UNDIRECTED). Labels are sorted and duplicate labels are automatically removed.

Meta