Class PhysicalNetwork.Modes

    • Constructor Detail

      • Modes

        public Modes()
    • Method Detail

      • registerMode

        protected Mode registerMode​(Mode mode)
        Add mode to the internal container
        Parameters:
        mode - to be registered in this network
        Returns:
        mode, in case it overrides an existing mode, the removed mode is returned
      • registerNewMode

        public Mode registerNewMode​(long externalModeId,
                                    String name,
                                    double pcu)
        Create and register new mode
        Parameters:
        externalModeId - the external mode id for the mode
        name - of the mode
        pcu - value for the mode
        Returns:
        new mode created
      • getNumberOfModes

        public int getNumberOfModes()
        Return number of registered modes
        Returns:
        number of registered modes
      • getModeById

        public Mode getModeById​(long id)
        Return a Mode by its id
        Parameters:
        id - the id of the Mode
        Returns:
        the specified mode
      • getFirst

        public Mode getFirst()
        Collect the first registered mode
        Returns:
        first registered mode if any
      • getModeByExternalId

        public Mode getModeByExternalId​(Object externalId,
                                        boolean convertToLong)
        Retrieve a Mode by its external Id This method has the option to convert the external Id parameter into a long value, to find the mode when mode objects use long values for external ids.
        Parameters:
        externalId - the external Id of the specified mode
        convertToLong - if true, the external Id is converted into a long before beginning the search
        Returns:
        the retrieved mode, or null if no mode was found
      • getModeByExternalId

        public Mode getModeByExternalId​(Object externalId)
        Retrieve a Mode by its external Id This method is not efficient, since it loops through all the registered modes in order to find the required time period. The equivalent method in InputBuilderListener is more efficient and should be used in preference to this in Java code.
        Parameters:
        externalId - the external Id of the specified mode
        Returns:
        the retrieved mode, or null if no mode was found