Package org.planit.utils.zoning
Interface Connectoid
-
- All Superinterfaces:
Comparable<Idable>
,ExternalIdable
,Idable
,Iterable<Zone>
- All Known Subinterfaces:
DirectedConnectoid
,UndirectedConnectoid
- All Known Implementing Classes:
ConnectoidImpl
,DirectedConnectoidImpl
,UndirectedConnectoidImpl
public interface Connectoid extends ExternalIdable, Iterable<Zone>
the connecting component between zone(s) and the network. Note that connectoids are not vertices, they merely refer to physical entities via derived interfaces and the physical network.Each combintation of (zone,connectoid) can have additional properties such as length or allowed modes. Not specifying thos will cause the use of defaults (DEFAULT_LENGTH_KM, all modes allowed)
- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static ConnectoidType
DEFAULT_CONNECTOID_TYPE
default type is set to nonestatic double
DEFAULT_LENGTH_KM
Default connectoid length in km
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Zone
addAccessZone(Zone zone)
add an access zone with default propertiesvoid
addAllowedMode(Zone zone, Mode... allowedModes)
add an allowed mode to the alreadyCollection<Zone>
getAccessZones()
the zones that can be accessed by this connectoidZone
getFirstAccessZone()
first available zone that is accessible based on the first entry the iterator returnsDouble
getLength(Zone accessZone)
length can be used to virtually assign a length to the connectoid/zone combinationString
getName()
The name of the connectoidlong
getNumberOfAccessZones()
the number of accessible zones registeredConnectoidType
getType()
The type of the connectoidboolean
hasAccessZone(Zone accessZone)
check if zone is registered as access zoneboolean
isModeAllowed(Zone accessZone, Mode mode)
Verify if a mode is allowed access to the zone via this connectoidvoid
setLength(Zone zone, double length)
add an access zone and provide length to this connectoidvoid
setName(String name)
Set the name of the connectoidvoid
setType(ConnectoidType type)
Set the type of the connectoid-
Methods inherited from interface org.planit.utils.id.ExternalIdable
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId
-
Methods inherited from interface org.planit.utils.id.Idable
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Field Detail
-
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 forlength
- to traverse between connectoid and zone
-
addAllowedMode
void addAllowedMode(Zone zone, Mode... allowedModes)
add an allowed mode to the already- Parameters:
zone
- to add allowed mode(s) toallowedModes
- 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
-
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
long getNumberOfAccessZones()
the number of accessible zones registered- Returns:
- number of accessible zones
-
getLength
Double getLength(Zone accessZone) throws PlanItException
length can be used to virtually assign a length to the connectoid/zone combination- Parameters:
accessZone
- to collect length for- Returns:
- length (null if zone is not registered)
- Throws:
PlanItException
- thrown if error
-
isModeAllowed
boolean isModeAllowed(Zone accessZone, Mode mode) throws PlanItException
Verify if a mode is allowed access to the zone via this connectoid- Parameters:
accessZone
- to verifymode
- to verify if allowed- Returns:
- true when allowed, false otherwise
- Throws:
PlanItException
- thrown if provided zone is not valid
-
-