Package org.goplanit.osm.defaults
Class OsmInfrastructureConfigurationImpl
- java.lang.Object
-
- org.goplanit.osm.defaults.OsmInfrastructureConfigurationImpl
-
- All Implemented Interfaces:
OsmInfrastructureConfiguration
- Direct Known Subclasses:
OsmHighwayTypeConfiguration
,OsmRailwayTypeConfiguration
public class OsmInfrastructureConfigurationImpl extends Object implements OsmInfrastructureConfiguration
Base class with common functionality for configuration OSM ways (highway/rail/waterway)- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>
activatedOsmTypes
the OSM types that are marked as supported OSM types, i.e., will be processed when parsingprotected Set<String>
deactivatedOsmTypes
the OSM types that are marked as deactivate OSM types, i.e., will be ignored when parsing unless activated.protected String
osmKey
way key this configuration applies to
-
Constructor Summary
Constructors Modifier Constructor Description protected
OsmInfrastructureConfigurationImpl(String osmWayKey)
Default constructorOsmInfrastructureConfigurationImpl(String osmKey, Set<String> activatedOsmTypes, Set<String> deactivatedOsmTypes)
Construct with defaults being populatedprotected
OsmInfrastructureConfigurationImpl(OsmInfrastructureConfigurationImpl toCopy)
Copy Constructor (deep copy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(String... osmWayTypeValues)
Choose to add a given way value to be on top of the defaults, e.g.void
activate(List<String> osmWayTypeValues)
Choose to add a given way value to be on top of the defaults, e.g.void
activateAll()
activate all types explicitlyvoid
deactivate(String osmValue)
Choose to not parse the given combination of way subtype, e.g.void
deactivateAll()
deactivate all types explicitlyOsmInfrastructureConfigurationImpl
deepClone()
Deep clone instanceMap<String,Set<String>>
getActivatedTypes()
create a copy of the currently supported way types in set formMap<String,Set<String>>
getDeactivatedTypes()
create a copy of the currently unsupported way types in set formboolean
isActivated(String osmValue)
Verify if the passed in OSM way type is explicitly supported.boolean
isDeactivated(String osmValue)
Verify if the passed in OSM way type is explicitly unsupported.void
logDeactivatedTypes()
Log all de-activated OSM way types
-
-
-
Field Detail
-
activatedOsmTypes
protected final Set<String> activatedOsmTypes
the OSM types that are marked as supported OSM types, i.e., will be processed when parsing
-
deactivatedOsmTypes
protected final Set<String> deactivatedOsmTypes
the OSM types that are marked as deactivate OSM types, i.e., will be ignored when parsing unless activated. This differs from unactivatableOsmTypes because deactivatesOsmTypes can in fact be activated whereas unactivatableOsmTypes cannot
-
osmKey
protected final String osmKey
way key this configuration applies to
-
-
Constructor Detail
-
OsmInfrastructureConfigurationImpl
protected OsmInfrastructureConfigurationImpl(String osmWayKey)
Default constructor- Parameters:
osmWayKey
- to apply
-
OsmInfrastructureConfigurationImpl
public OsmInfrastructureConfigurationImpl(String osmKey, Set<String> activatedOsmTypes, Set<String> deactivatedOsmTypes)
Construct with defaults being populated- Parameters:
osmKey
- to applyactivatedOsmTypes
- to usedeactivatedOsmTypes
- to use
-
OsmInfrastructureConfigurationImpl
protected OsmInfrastructureConfigurationImpl(OsmInfrastructureConfigurationImpl toCopy)
Copy Constructor (deep copy)- Parameters:
toCopy
- to copy
-
-
Method Detail
-
logDeactivatedTypes
public void logDeactivatedTypes()
Log all de-activated OSM way types- Specified by:
logDeactivatedTypes
in interfaceOsmInfrastructureConfiguration
-
isDeactivated
public boolean isDeactivated(String osmValue)
Verify if the passed in OSM way type is explicitly unsupported. Unsupported types will be ignored when processing ways.- Specified by:
isDeactivated
in interfaceOsmInfrastructureConfiguration
- Parameters:
osmValue
- , e.g. primary, road- Returns:
- true when unSupported, false if not (which means it is either supported, or not registered)
-
isActivated
public boolean isActivated(String osmValue)
Verify if the passed in OSM way type is explicitly supported. Supported types will be processed and converted into link(segments).- Specified by:
isActivated
in interfaceOsmInfrastructureConfiguration
- Parameters:
osmValue
- , e.g. primary- Returns:
- true when supported, false if not (which means it is unsupported, or not registered)
-
deactivate
public void deactivate(String osmValue)
Choose to not parse the given combination of way subtype, e.g. highway=road- Specified by:
deactivate
in interfaceOsmInfrastructureConfiguration
- Parameters:
osmValue
- to use
-
activate
public void activate(String... osmWayTypeValues)
Choose to add a given way value to be on top of the defaults, e.g. highway=road- Specified by:
activate
in interfaceOsmInfrastructureConfiguration
- Parameters:
osmWayTypeValues
- to activate
-
activate
public void activate(List<String> osmWayTypeValues)
Choose to add a given way value to be on top of the defaults, e.g. highway=road- Specified by:
activate
in interfaceOsmInfrastructureConfiguration
- Parameters:
osmWayTypeValues
- to activate
-
getActivatedTypes
public Map<String,Set<String>> getActivatedTypes()
create a copy of the currently supported way types in set form- Specified by:
getActivatedTypes
in interfaceOsmInfrastructureConfiguration
- Returns:
- set of supported types (by underlying key), any modifications on this set have no impact on the instance internals
-
getDeactivatedTypes
public Map<String,Set<String>> getDeactivatedTypes()
create a copy of the currently unsupported way types in set form- Specified by:
getDeactivatedTypes
in interfaceOsmInfrastructureConfiguration
- Returns:
- deactivated way types (by underlying key), any modifications on this set have no impact on the instance internals
-
deactivateAll
public void deactivateAll()
deactivate all types explicitly- Specified by:
deactivateAll
in interfaceOsmInfrastructureConfiguration
-
activateAll
public void activateAll()
activate all types explicitly- Specified by:
activateAll
in interfaceOsmInfrastructureConfiguration
-
deepClone
public OsmInfrastructureConfigurationImpl deepClone()
Deep clone instance- Specified by:
deepClone
in interfaceOsmInfrastructureConfiguration
- Returns:
- deep clone
-
-