Package org.planit.network.converter
Class IdMapperFunctionFactory
- java.lang.Object
-
- org.planit.network.converter.IdMapperFunctionFactory
-
public class IdMapperFunctionFactory extends Object
Factory that creates functions for id mapping from PLANit ids to ids to be used for persistence. Based on the passed in IdMapper type functions will generate different ids when applied to nodes, link segments, etc.- Author:
- markr
-
-
Constructor Summary
Constructors Constructor Description IdMapperFunctionFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static <T extends ExternalIdable>
Function<T,String>createIdMappingFunction(Class<T> clazz, IdMapperType idMapper)
create a function that takes a a class that extendsExternalIdable
and generate the appropriate id based on the user configurationstatic Function<Link,String>
createLinkIdMappingFunction(IdMapperType idMapper)
create a function that takes a link and generates the appropriate id based on the user configurationstatic Function<MacroscopicLinkSegment,String>
createLinkSegmentIdMappingFunction(IdMapperType idMapper)
create a function that takes a link segment and (optional) id mapper and generates the appropriate MATSIM link id based on the user configurationstatic Function<MacroscopicLinkSegmentType,String>
createLinkSegmentTypeIdMappingFunction(IdMapperType idMapper)
create a function that takes a link segment type and generates the appropriate id based on the user configurationstatic Function<Mode,String>
createModeIdMappingFunction(IdMapperType idMapper)
create a function that takes a mode and generates the appropriate id based on the user configurationstatic Function<Node,String>
createNodeIdMappingFunction(IdMapperType idMapper)
create a function that takes a node and generates the appropriate id based on the user configuration
-
-
-
Method Detail
-
createIdMappingFunction
protected static <T extends ExternalIdable> Function<T,String> createIdMappingFunction(Class<T> clazz, IdMapperType idMapper) throws PlanItException
create a function that takes a a class that extendsExternalIdable
and generate the appropriate id based on the user configuration- Type Parameters:
T
- ExternalIdable- Parameters:
clazz
- to useidMapper
- the type of mapping function to create- Returns:
- function that generates node id's for MATSIM node output
- Throws:
PlanItException
- thrown if error
-
createNodeIdMappingFunction
public static Function<Node,String> createNodeIdMappingFunction(IdMapperType idMapper) throws PlanItException
create a function that takes a node and generates the appropriate id based on the user configuration- Parameters:
idMapper
- the type of mapping function to create- Returns:
- function that generates node id's for MATSIM node output
- Throws:
PlanItException
- thrown if error
-
createLinkIdMappingFunction
public static Function<Link,String> createLinkIdMappingFunction(IdMapperType idMapper) throws PlanItException
create a function that takes a link and generates the appropriate id based on the user configuration- Parameters:
idMapper
- the type of mapping function to create- Returns:
- function that generates mapped link id's for persistence
- Throws:
PlanItException
- thrown if error
-
createLinkSegmentTypeIdMappingFunction
public static Function<MacroscopicLinkSegmentType,String> createLinkSegmentTypeIdMappingFunction(IdMapperType idMapper) throws PlanItException
create a function that takes a link segment type and generates the appropriate id based on the user configuration- Parameters:
idMapper
- the type of mapping function to create- Returns:
- function that generates mapped link segment type id's for persistence
- Throws:
PlanItException
- thrown if error
-
createLinkSegmentIdMappingFunction
public static Function<MacroscopicLinkSegment,String> createLinkSegmentIdMappingFunction(IdMapperType idMapper) throws PlanItException
create a function that takes a link segment and (optional) id mapper and generates the appropriate MATSIM link id based on the user configuration- Parameters:
idMapper
- that generates mapped link segment id's for persistence- Returns:
- created function
- Throws:
PlanItException
- thrown if error
-
createModeIdMappingFunction
public static Function<Mode,String> createModeIdMappingFunction(IdMapperType idMapper) throws PlanItException
create a function that takes a mode and generates the appropriate id based on the user configuration- Parameters:
idMapper
- the type of mapping function to create- Returns:
- function that generates mapped mode id's for persistence
- Throws:
PlanItException
- thrown if error
-
-