Class ConnectoidImpl

    • Constructor Detail

      • ConnectoidImpl

        protected ConnectoidImpl​(IdGroupingToken idToken)
        Constructor
        Parameters:
        idToken - contiguous id generation within this group for instances of this class
      • ConnectoidImpl

        protected ConnectoidImpl​(ConnectoidImpl connectoidImpl)
        Copy constructor
        Parameters:
        connectoidImpl - to copy
      • ConnectoidImpl

        protected ConnectoidImpl​(IdGroupingToken idToken,
                                 Zone accessZone,
                                 double length)
        Constructor
        Parameters:
        idToken - contiguous id generation within this group for instances of this class
        accessZone - for the connectoid
        length - for the connection
    • Method Detail

      • generateConnectoidId

        protected static long generateConnectoidId​(IdGroupingToken groupId)
        Generate connectoid id
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        Returns:
        id of connectoid
      • setType

        public void setType​(ConnectoidType type)
        Set the type of the connectoid
        Specified by:
        setType in interface Connectoid
        Parameters:
        type - its type
      • setName

        public void setName​(String name)
        Set the name of the connectoid
        Specified by:
        setName in interface Connectoid
        Parameters:
        name - its name
      • getName

        public String getName()
        The name of the connectoid
        Specified by:
        getName in interface Connectoid
        Returns:
        its name
      • getAccessZones

        public Collection<Zone> getAccessZones()
        the zones that can be accessed by this connectoid
        Specified by:
        getAccessZones in interface Connectoid
        Returns:
        accessible zones
      • getFirstAccessZone

        public Zone getFirstAccessZone()
        first available zone that is accessible based on the first entry the iterator returns
        Specified by:
        getFirstAccessZone in interface Connectoid
        Returns:
        first available zone
      • getNumberOfAccessZones

        public long getNumberOfAccessZones()
        the number of accessible zones registered
        Specified by:
        getNumberOfAccessZones in interface Connectoid
        Returns:
        number of accessible zones
      • getLength

        public Double getLength​(Zone accessZone)
        length can be used to virtually assign a length to the connectoid/zone combination
        Specified by:
        getLength in interface Connectoid
        Parameters:
        accessZone - to collect length for
        Returns:
        length (null if zone is not registered)
      • addAccessZone

        public Zone addAccessZone​(Zone accessZone)
        add an access zone with default properties
        Specified by:
        addAccessZone in interface Connectoid
        Parameters:
        accessZone - to register as accessible
        Returns:
        overwritten zone if any
      • isModeAllowed

        public boolean isModeAllowed​(Zone accessZone,
                                     Mode mode)
                              throws PlanItException
        Verify if a mode is allowed access to the zone via this connectoid
        Specified by:
        isModeAllowed in interface Connectoid
        Parameters:
        accessZone - to verify
        mode - to verify if allowed
        Returns:
        true when allowed, false otherwise
        Throws:
        PlanItException - thrown if provided zone is not valid
      • hasAccessZone

        public boolean hasAccessZone​(Zone accessZone)
        check if zone is registered as access zone
        Specified by:
        hasAccessZone in interface Connectoid
        Parameters:
        accessZone - to verify
        Returns:
        true when registered, false otherwise
      • setLength

        public void setLength​(Zone accessZone,
                              double length)
        add an access zone and provide length to this connectoid
        Specified by:
        setLength in interface Connectoid
        Parameters:
        accessZone - to set length for
        length - to traverse between connectoid and zone
      • addAllowedMode

        public void addAllowedMode​(Zone accessZone,
                                   Mode... allowedModes)
        add an allowed mode to the already
        Specified by:
        addAllowedMode in interface Connectoid
        Parameters:
        accessZone - to add allowed mode(s) to
        allowedModes - to add