Class AbstractIdentifiableSingleEntityMergeStrategy<T extends IdentityBean<?>>
java.lang.Object
org.onebusaway.gtfs_merge.strategies.AbstractEntityMergeStrategy
org.onebusaway.gtfs_merge.strategies.AbstractSingleEntityMergeStrategy<T>
org.onebusaway.gtfs_merge.strategies.AbstractIdentifiableSingleEntityMergeStrategy<T>
- Type Parameters:
T- the type of the GTFS entity that this merge strategy handles
- All Implemented Interfaces:
EntityMergeStrategy
- Direct Known Subclasses:
AgencyMergeStrategy,AreaMergeStrategy,FareAttributeMergeStrategy,FeedInfoMergeStrategy,RouteMergeStrategy,StopMergeStrategy,TripMergeStrategy
public abstract class AbstractIdentifiableSingleEntityMergeStrategy<T extends IdentityBean<?>>
extends AbstractSingleEntityMergeStrategy<T>
Abstract base class that defines common methods and properties for merging
single GTFS entities with explicit identifiers in a GTFS feed.
- Author:
- bdferris
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AndDuplicateScoringStrategy<T> When comparing entities between two feeds to see if they are duplicates, we use the specified scoring strategy to score the amount of duplication between the two entities.Fields inherited from class org.onebusaway.gtfs_merge.strategies.AbstractSingleEntityMergeStrategy
_entityTypeFields inherited from class org.onebusaway.gtfs_merge.strategies.AbstractEntityMergeStrategy
_duplicateDetectionStrategy, _logDuplicatesStrategy, _minElementDuplicateScoreForFuzzyMatch, _minElementsDuplicateScoreForAutoDetect, _minElementsInCommonScoreForAutoDetect -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected IdentityBean<?> getFuzzyDuplicate(GtfsMergeContext context, IdentityBean<?> entity) UseEDuplicateDetectionStrategy.FUZZYbased duplication-detection to find a duplicate in the output merged feed for the specified entity.protected IdentityBean<?> getIdentityDuplicate(GtfsMergeContext context, IdentityBean<?> entity) UseEDuplicateDetectionStrategy.IDENTITYbased duplication-detection to find a duplicate in the output merged feed for the specified entity.protected EDuplicateDetectionStrategyDetermines the bestEDuplicateDetectionStrategyto use for merging entities from the current source feed into the merged output feed.protected voidrename(GtfsMergeContext context, IdentityBean<?> entity) Rename the id of the specified identity to avoid an raw GTFS identifier collision in the merged output feed.protected voidsave(GtfsMergeContext context, IdentityBean<?> entity) Saves the specified entity to the merged output feed.Methods inherited from class org.onebusaway.gtfs_merge.strategies.AbstractSingleEntityMergeStrategy
getDescription, getEntityTypes, merge, mergeEntity, rejectDuplicateOverDifferences, replaceDuplicateEntryMethods inherited from class org.onebusaway.gtfs_merge.strategies.AbstractEntityMergeStrategy
determineDuplicateDetectionStrategy, getDuplicateRenamingStrategy, setDuplicateDetectionStrategy, setDuplicateRenamingStrategy, setLogDuplicatesStrategy
-
Field Details
-
_duplicateScoringStrategy
When comparing entities between two feeds to see if they are duplicates, we use the specified scoring strategy to score the amount of duplication between the two entities. Sub-classes can add rules to this scoring strategy specific to their entity type to guide duplication scoring.
-
-
Constructor Details
-
AbstractIdentifiableSingleEntityMergeStrategy
-
-
Method Details
-
pickBestDuplicateDetectionStrategy
Description copied from class:AbstractEntityMergeStrategyDetermines the bestEDuplicateDetectionStrategyto use for merging entities from the current source feed into the merged output feed. Sub-classes are required to provide the most appropriate strategy for merging their particular entity type.- Specified by:
pickBestDuplicateDetectionStrategyin classAbstractEntityMergeStrategy- Parameters:
context-- Returns:
-
getIdentityDuplicate
Description copied from class:AbstractSingleEntityMergeStrategyUseEDuplicateDetectionStrategy.IDENTITYbased duplication-detection to find a duplicate in the output merged feed for the specified entity.- Specified by:
getIdentityDuplicatein classAbstractSingleEntityMergeStrategy<T extends IdentityBean<?>>- Parameters:
context-entity-- Returns:
- a duplicate entity with the specified id or null if none exists.
-
getFuzzyDuplicate
Description copied from class:AbstractSingleEntityMergeStrategyUseEDuplicateDetectionStrategy.FUZZYbased duplication-detection to find a duplicate in the output merged feed for the specified entity.- Overrides:
getFuzzyDuplicatein classAbstractSingleEntityMergeStrategy<T extends IdentityBean<?>>- Parameters:
context-entity-- Returns:
- a duplicate entity that fuzzily matches the specified entity or null if none exists.
-
save
Saves the specified entity to the merged output feed. If the raw id of the entity duplicates an existing entity in the output feed, its id will be renamed.- Overrides:
savein classAbstractSingleEntityMergeStrategy<T extends IdentityBean<?>>- Parameters:
context-entity-
-
rename
Rename the id of the specified identity to avoid an raw GTFS identifier collision in the merged output feed.- Parameters:
context-entity-
-