Interface Connectoid

    • Field Detail

      • CONNECTOID_ID_CLASS

        static final Class<Connectoid> CONNECTOID_ID_CLASS
        the class ot use for id generation
      • DEFAULT_LENGTH_KM

        static final double DEFAULT_LENGTH_KM
        Default connectoid length in km
        See Also:
        Constant Field Values
      • DEFAULT_CONNECTOID_TYPE

        static final ConnectoidType DEFAULT_CONNECTOID_TYPE
        default type is set to none
    • Method Detail

      • setName

        void setName​(String name)
        Set the name of the connectoid
        Parameters:
        name - its name
      • getName

        String getName()
        The name of the connectoid
        Returns:
        its name
      • setType

        void setType​(ConnectoidType type)
        Set the type of the connectoid
        Parameters:
        type - its type
      • getType

        ConnectoidType getType()
        The type of the connectoid
        Returns:
        its type
      • getAccessZones

        Collection<Zone> getAccessZones()
        The zones that can be accessed by this connectoid
        Returns:
        accessible zones
      • setLength

        void setLength​(Zone zone,
                       double length)
        Add an access zone and provide length to this connectoid
        Parameters:
        zone - to set length for
        length - to traverse between connectoid and zone
      • addAllowedMode

        void addAllowedMode​(Zone zone,
                            Mode allowedMode)
        Add an allowed mode. We assume the zone is already registered as an access zone for this connectoid
        Parameters:
        zone - to add allowed mode to
        allowedMode - to add
      • addAccessZone

        Zone addAccessZone​(Zone zone)
        Add an access zone with default properties
        Parameters:
        zone - to register as accessible
        Returns:
        overwritten zone if any
      • addAllAccessZones

        default void addAllAccessZones​(Collection<Zone> accessZonesToAdd)
        Add all provided access zones
        Parameters:
        accessZonesToAdd - to add
      • hasAccessZone

        boolean hasAccessZone​(Zone accessZone)
        Check if zone is registered as access zone
        Parameters:
        accessZone - to verify
        Returns:
        true when registered, false otherwise
      • getFirstAccessZone

        Zone getFirstAccessZone()
        first available zone that is accessible based on the first entry the iterator returns
        Returns:
        first available zone
      • getNumberOfAccessZones

        int getNumberOfAccessZones()
        the number of accessible zones registered
        Returns:
        number of accessible zones
      • getLengthKm

        Optional<Double> getLengthKm​(Zone accessZone)
        length can be used to virtually assign a length to the connectoid/zone combination
        Parameters:
        accessZone - to collect length for
        Returns:
        length in km(null if zone is not registered)
      • isModeAllowed

        boolean isModeAllowed​(Zone accessZone,
                              Mode mode)
        Verify if a mode is allowed access to the zone via this connectoid
        Parameters:
        accessZone - to verify
        mode - to verify if allowed
        Returns:
        true when allowed, false otherwise
      • getExplicitlyAllowedModes

        Collection<Mode> getExplicitlyAllowedModes​(Zone accessZone)
        collect modes that are explicitly allowed for this zone (unmodifiable). Note that if no explicit allowed modes are present, all modes are implicitly allowed. When there exist explicitly allowed modes, any modes in the network not included in the explicitly allowed modes are regarded to not be allowed.
        Parameters:
        accessZone - to check
        Returns:
        the modes explicitly allowed for this zone, null if none
      • getAccessVertex

        DirectedVertex getAccessVertex()
        collect the access vertex for this connectoid
        Returns:
        access vertex
      • getIdClass

        default Class<Connectoid> getIdClass()
        Each managed id class is expected to generate its ids based on its class signature. To be able to generate the correct id the class used for id generation is to be provided via this method call.
        Specified by:
        getIdClass in interface ManagedId
        Returns:
        idClass to use for generating ids for instances of this idable derived class
      • hasName

        default boolean hasName()
        Verify if the connectoid has a name
        Returns:
        true when present false otherwise
      • addAllowedModes

        default void addAllowedModes​(Zone zone,
                                     Mode... allowedModes)
        Add allowed modes. We assume the zone is already registered as an access zone for this connectoid
        Parameters:
        zone - to add allowed mode(s) to
        allowedModes - to add
      • addAllowedModes

        default void addAllowedModes​(Zone transferZone,
                                     Collection<Mode> allowedModes)
        Add allowed modes. We assume the zone is already registered as an access zone for this connectoid
        Parameters:
        transferZone - to add allowed mode(s) to
        allowedModes - to add
      • hasExplicitlyAllowedModes

        default boolean hasExplicitlyAllowedModes​(Zone accessZone)
        Verify if any modes are allowed for this zone
        Parameters:
        accessZone - to check
        Returns:
        true when at least one mode is allowed, false otherwise
      • isAllModesAllowed

        default boolean isAllModesAllowed​(Zone accessZone)
        Verify if all modes are allowed for this zone
        Parameters:
        accessZone - to check
        Returns:
        true when we know for certain all modes are allowed, false otherwise
      • hasLength

        default boolean hasLength​(Zone accessZone)
        Verify if a length has been specified for the access zone to connectoid combination
        Parameters:
        accessZone - to verify
        Returns:
        true if present, false otherwise
      • hasAccessZones

        default boolean hasAccessZones()
        Verify if access zones are registered
        Returns:
        true when present, false otherwise
      • shallowClone

        Connectoid shallowClone()
        Create a shallow copy of this entity
        Specified by:
        shallowClone in interface IdAble
        Returns:
        shallow copy of entity
      • deepClone

        Connectoid deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface IdAble
        Returns:
        deep copy of entity