Class AbstractIdentifiableSingleEntityMergeStrategy<T extends org.onebusaway.gtfs.model.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 org.onebusaway.gtfs.model.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 org.onebusaway.gtfs.model.IdentityBean<?> getFuzzyDuplicate(GtfsMergeContext context, org.onebusaway.gtfs.model.IdentityBean<?> entity) UseEDuplicateDetectionStrategy.FUZZYbased duplication-detection to find a duplicate in the output merged feed for the specified entity.protected org.onebusaway.gtfs.model.IdentityBean<?> getIdentityDuplicate(GtfsMergeContext context, org.onebusaway.gtfs.model.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, org.onebusaway.gtfs.model.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, org.onebusaway.gtfs.model.IdentityBean<?> entity) Saves the specified entity to the merged output feed.toString()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
protected AndDuplicateScoringStrategy<T extends org.onebusaway.gtfs.model.IdentityBean<?>> _duplicateScoringStrategyWhen 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
protected org.onebusaway.gtfs.model.IdentityBean<?> getIdentityDuplicate(GtfsMergeContext context, org.onebusaway.gtfs.model.IdentityBean<?> entity) 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 org.onebusaway.gtfs.model.IdentityBean<?>>- Parameters:
context-entity-- Returns:
- a duplicate entity with the specified id or null if none exists.
-
getFuzzyDuplicate
protected org.onebusaway.gtfs.model.IdentityBean<?> getFuzzyDuplicate(GtfsMergeContext context, org.onebusaway.gtfs.model.IdentityBean<?> entity) 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 org.onebusaway.gtfs.model.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 org.onebusaway.gtfs.model.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-
-
toString
-