Class EditClassCount
java.lang.Object
org.variantsync.diffdetective.metadata.EditClassCount
- All Implemented Interfaces:
Metadata<EditClassCount>
Metadata that tracks how often edit classes were matched.
- Author:
- Paul Bittner
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCounts the occurrences of a data point across commits. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AnalysisResult.ResultKey<EditClassCount> private final LinkedHashMap<EditClass, EditClassCount.Occurrences> -
Constructor Summary
ConstructorsConstructorDescriptionEditClassCount(EditClassCatalogue editClasses) Create a new empty count that reports occurrences of the given edit class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the current occurrence count for each considered edit class.static org.variantsync.functjonal.category.InplaceSemigroup<EditClassCount> Composes two edit class counts by composing their respective occurrence counts for each edit class.static EditClassCountParses lines containingedit classestoEditClassCount.voidreportOccurrenceFor(EditClass editClass, CommitDiff commit) Report the match of the given edit class in the given commit diff.org.variantsync.functjonal.category.InplaceSemigroup<EditClassCount> Mutates and returns first element.voidsetFromSnapshot(LinkedHashMap<String, String> snap) snapshot()Create a key-value store of the metadata that can be used for serialization.
-
Field Details
-
KEY
-
occurrences
-
-
Constructor Details
-
EditClassCount
Create a new empty count that reports occurrences of the given edit class.- Parameters:
editClasses- edit classes whose occurrences should be counted.
-
-
Method Details
-
ISEMIGROUP
Composes two edit class counts by composing their respective occurrence counts for each edit class.- See Also:
-
reportOccurrenceFor
Report the match of the given edit class in the given commit diff. The count of the given edit class will be incremented and the commit will be memorized as one of the commits in which this edit class was matched.- Parameters:
editClass- The edit class that was matched.commit- The CommitDiff in which the edit class match occurred.- Throws:
AssertionError- when the given edit class is not present this counts catalog.- See Also:
-
parse
Parses lines containingedit classestoEditClassCount.- Parameters:
lines- Lines containingedit classesto be parsed- Returns:
EditClassCount
-
snapshot
Description copied from interface:MetadataCreate a key-value store of the metadata that can be used for serialization.- Specified by:
snapshotin interfaceMetadata<EditClassCount>- Returns:
- A LinkedHashMap that stores all relevant properties to export. The return type has to be a LinkedHashMap to obtain insertion-order iteration.
-
setFromSnapshot
- Specified by:
setFromSnapshotin interfaceMetadata<EditClassCount>
-
semigroup
Mutates and returns first element.- Specified by:
semigroupin interfaceMetadata<EditClassCount>
-
getOccurrences
Returns the current occurrence count for each considered edit class.
-