Class 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 Detail

      • IdMapperFunctionFactory

        public IdMapperFunctionFactory()
    • Method Detail

      • createIdMappingFunction

        protected static <T extends ExternalIdAbleFunction<T,​String> createIdMappingFunction​(Class<T> clazz,
                                                                                                     IdMapperType idMapper)
                                                                                              throws PlanItException
        create a function that takes a a class that extends ExternalIdAble and generate the appropriate id based on the user configuration
        Type Parameters:
        T - ExternalIdable
        Parameters:
        clazz - to use
        idMapper - the type of mapping function to create
        Returns:
        function that generates node id's for MATSIM node output
        Throws:
        PlanItException - thrown if error
      • createVertexIdMappingFunction

        public static Function<Vertex,​String> createVertexIdMappingFunction​(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
      • createConnectoidIdMappingFunction

        public static Function<Connectoid,​String> createConnectoidIdMappingFunction​(IdMapperType idMapper)
                                                                                   throws PlanItException
        create a function that takes a connectoid and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates directed connectoi id's for node output
        Throws:
        PlanItException - thrown if error
      • createZoneIdMappingFunction

        public static Function<Zone,​String> createZoneIdMappingFunction​(IdMapperType idMapper)
                                                                       throws PlanItException
        create a function that takes a zone and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates zone id's for zone output
        Throws:
        PlanItException - thrown if error
      • createTransferZoneGroupIdMappingFunction

        public static Function<TransferZoneGroup,​String> createTransferZoneGroupIdMappingFunction​(IdMapperType idMapper)
                                                                                                 throws PlanItException
        create a function that takes a transfer zone group and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates transfer zone group id's for transfer zone group output
        Throws:
        PlanItException - thrown if error