Class DirectedEdgeLabelFormat
java.lang.Object
org.variantsync.diffdetective.variation.diff.serialize.edgeformat.EdgeLabelFormat<DiffLinesLabel>
org.variantsync.diffdetective.mining.formats.DirectedEdgeLabelFormat
- All Implemented Interfaces:
LinegraphFormat
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final record
DirectedEdgeLabelFormat.Edge<L extends DiffLinesLabel>
Nested classes/interfaces inherited from class org.variantsync.diffdetective.variation.diff.serialize.edgeformat.EdgeLabelFormat
EdgeLabelFormat.Direction
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private final MiningNodeFormat
private final boolean
-
Constructor Summary
ConstructorDescriptionDirectedEdgeLabelFormat
(MiningNodeFormat nodeFormatter) DirectedEdgeLabelFormat
(MiningNodeFormat nodeFormatter, boolean useDirectionHeuristic, EdgeLabelFormat.Direction direction) -
Method Summary
Modifier and TypeMethodDescriptionprotected <L extends DiffLinesLabel>
voidconnectAccordingToLabel
(DiffNode<L> child, DiffNode<L> parent, String edgeLabel) Adds the given child node as the child of the given parent node for all times described by the given label (viaDiffNode.addChild(DiffNode, Time)
) In particular, this method checks if the given edge label starts withLineGraphConstants.BEFORE_PARENT
,LineGraphConstants.AFTER_PARENT
, orLineGraphConstants.BEFORE_AND_AFTER_PARENT
and connects both nodes accordingly.Name of the format that uniquely identifies the format.<L extends DiffLinesLabel>
StringlabelOf
(StyledEdge<L> edge) Converts aStyledEdge
into a label suitable for exporting.private <L extends DiffLinesLabel>
DirectedEdgeLabelFormat.Edge<L>recoverEdgeDirectionFromLabelIfPossible
(DiffNode<L> hypothesizedFrom, DiffNode<L> hypothesizedTo, String edgeLabel) Methods inherited from class org.variantsync.diffdetective.variation.diff.serialize.edgeformat.EdgeLabelFormat
connect, getEdgeDirection, multilineLabelOf, setEdgeDirection
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.variantsync.diffdetective.variation.diff.serialize.LinegraphFormat
getShortName
-
Field Details
-
LABEL_SEPARATOR
- See Also:
-
nodeFormatter
-
useDirectionHeuristic
private final boolean useDirectionHeuristic
-
-
Constructor Details
-
DirectedEdgeLabelFormat
-
DirectedEdgeLabelFormat
public DirectedEdgeLabelFormat(MiningNodeFormat nodeFormatter, boolean useDirectionHeuristic, EdgeLabelFormat.Direction direction)
-
-
Method Details
-
recoverEdgeDirectionFromLabelIfPossible
private <L extends DiffLinesLabel> DirectedEdgeLabelFormat.Edge<L> recoverEdgeDirectionFromLabelIfPossible(DiffNode<L> hypothesizedFrom, DiffNode<L> hypothesizedTo, String edgeLabel) -
connectAccordingToLabel
protected <L extends DiffLinesLabel> void connectAccordingToLabel(DiffNode<L> child, DiffNode<L> parent, String edgeLabel) Description copied from class:EdgeLabelFormat
Adds the given child node as the child of the given parent node for all times described by the given label (viaDiffNode.addChild(DiffNode, Time)
) In particular, this method checks if the given edge label starts withLineGraphConstants.BEFORE_PARENT
,LineGraphConstants.AFTER_PARENT
, orLineGraphConstants.BEFORE_AND_AFTER_PARENT
and connects both nodes accordingly.- Overrides:
connectAccordingToLabel
in classEdgeLabelFormat<DiffLinesLabel>
- Parameters:
child
- The node that should be the child of the given parent at the times described by the label.parent
- The node that should be the parent of the given child at the times described by the label.edgeLabel
- The label that describes the time, the edge exists at, by being prefixed with one of the LineGraphConstants described above.
-
labelOf
Description copied from class:EdgeLabelFormat
Converts aStyledEdge
into a label suitable for exporting. This may be human readable text or machine parseable metadata.- Specified by:
labelOf
in classEdgeLabelFormat<DiffLinesLabel>
- Parameters:
edge
- TheStyledEdge
to be labeled- Returns:
- a label for
edge
-
getIdentifier
Description copied from interface:LinegraphFormat
Name of the format that uniquely identifies the format.
-