Package org.goplanit.zoning
Class TransferZoneImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.zoning.ZoneImpl
-
- org.goplanit.zoning.TransferZoneImpl
-
- All Implemented Interfaces:
Comparable<IdAble>,ExternalIdAble,IdAble,ManagedId,TransferZone,Zone
public class TransferZoneImpl extends ZoneImpl implements TransferZone
A transfer zone- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.zoning.ZoneImpl
centroid, geometry, inputProperties, name
-
Fields inherited from interface org.goplanit.utils.zoning.TransferZone
DEFAULT_TYPE, TRANSFER_ZONE_ID_CLASS
-
Fields inherited from interface org.goplanit.utils.zoning.Zone
LOGGER, ZONE_ID_CLASS
-
-
Constructor Summary
Constructors Constructor Description TransferZoneImpl(IdGroupingToken tokenId)constructorTransferZoneImpl(TransferZoneImpl other, boolean deepCopy)Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToTransferZoneGroup(TransferZoneGroup transferZoneGroup)register this transfer zone group as a group this transfer zone is part ofbooleanaddTransferZonePlatformName(String platformName)Add platform name for this transfer zoneTransferZoneImpldeepClone()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.protected static longgenerateTransferZoneId(IdGroupingToken tokenId)generate unique od zone idSet<TransferZoneGroup>getTransferZoneGroups()All transfer zone groups the transfer zone resides in (unmodifiable)longgetTransferZoneId()In addition to a zone id across all zones of any derived type, each transfer zone also has a unique id across the transfer zones specificallyList<String>getTransferZonePlatformNames()Unmodifiable list of registered platform names for this transfer zone (if any).TransferZoneTypegetTransferZoneType()collect the type of this transfer zonebooleanhasTransferZoneGroup()Verify if a transfer zone is part of one or more transfer zone groupsbooleanisInTransferZoneGroup(TransferZoneGroup transferZoneGroup)Verify if transfer zone is part of passed in transfer zone grouplongrecreateManagedIds(IdGroupingToken tokenId)recreate the internal id(s) and set them including the Idable idvoidremoveFromAllTransferZoneGroups()remove this transfer zone from all groups it is registered on (and also update the group referencesbooleanremoveFromTransferZoneGroup(TransferZoneGroup transferZoneGroup)remove from transfer zone group provided and also remove ths transfer zone from group providedbooleanremoveTransferZonePlatformName(String platformName)Remove a platform name if presentprotected voidsetTransferZoneId(long transferZoneId)Set transfer zone IdvoidsetType(TransferZoneType type)set the type of this transfer zoneTransferZoneImplshallowClone()Create a shallow copy of this entity-
Methods inherited from class org.goplanit.zoning.ZoneImpl
addInputProperty, generateZoneId, getCentroid, getGeometry, getInputProperty, getName, setCentroid, setGeometry, setId, setName, toString
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
resetChildManagedIdEntities
-
Methods inherited from interface org.goplanit.utils.zoning.TransferZone
addTransferZonePlatformNames, addTransferZonePlatformNames, getTransferZoneIdClass, hasPlatformNames
-
Methods inherited from interface org.goplanit.utils.zoning.Zone
addInputProperty, getCentroid, getEnvelope, getGeometry, getGeometry, getIdClass, getInputProperty, getName, hasCentroid, hasGeometry, hasInputProperty, hasName, setGeometry, setName
-
-
-
-
Constructor Detail
-
TransferZoneImpl
public TransferZoneImpl(IdGroupingToken tokenId)
constructor- Parameters:
tokenId- for id generation
-
TransferZoneImpl
public TransferZoneImpl(TransferZoneImpl other, boolean deepCopy)
Copy constructor- Parameters:
other- to copydeepCopy- when true, create a eep copy, shallow copy otherwise
-
-
Method Detail
-
generateTransferZoneId
protected static long generateTransferZoneId(IdGroupingToken tokenId)
generate unique od zone id- Parameters:
tokenId- contiguous id generation within this group for instances of this class- Returns:
- odZoneId
-
setTransferZoneId
protected void setTransferZoneId(long transferZoneId)
Set transfer zone Id- Parameters:
transferZoneId- to set
-
getTransferZoneId
public long getTransferZoneId()
In addition to a zone id across all zones of any derived type, each transfer zone also has a unique id across the transfer zones specifically- Specified by:
getTransferZoneIdin interfaceTransferZone- Returns:
- transfer zone specific id
-
getTransferZonePlatformNames
public List<String> getTransferZonePlatformNames()
Unmodifiable list of registered platform names for this transfer zone (if any).- Specified by:
getTransferZonePlatformNamesin interfaceTransferZone- Returns:
- transfer zone platform names if any were registered
-
addTransferZonePlatformName
public boolean addTransferZonePlatformName(String platformName)
Add platform name for this transfer zone- Specified by:
addTransferZonePlatformNamein interfaceTransferZone- Parameters:
platformName- to add- Returns:
- true if newly added, false otherwise
-
removeTransferZonePlatformName
public boolean removeTransferZonePlatformName(String platformName)
Remove a platform name if present- Specified by:
removeTransferZonePlatformNamein interfaceTransferZone- Parameters:
platformName- to remove- Returns:
- true when removed, false otherwise
-
setType
public void setType(TransferZoneType type)
set the type of this transfer zone- Specified by:
setTypein interfaceTransferZone- Parameters:
type- to set
-
getTransferZoneType
public TransferZoneType getTransferZoneType()
collect the type of this transfer zone- Specified by:
getTransferZoneTypein interfaceTransferZone- Returns:
- transfer zone type
-
hasTransferZoneGroup
public boolean hasTransferZoneGroup()
Verify if a transfer zone is part of one or more transfer zone groups- Specified by:
hasTransferZoneGroupin interfaceTransferZone- Returns:
- true when in transfer zone group, false otherwise
-
isInTransferZoneGroup
public boolean isInTransferZoneGroup(TransferZoneGroup transferZoneGroup)
Verify if transfer zone is part of passed in transfer zone group- Specified by:
isInTransferZoneGroupin interfaceTransferZone- Parameters:
transferZoneGroup- to check- Returns:
- true when part of group, false otherwise
-
addToTransferZoneGroup
public void addToTransferZoneGroup(TransferZoneGroup transferZoneGroup)
register this transfer zone group as a group this transfer zone is part of- Specified by:
addToTransferZoneGroupin interfaceTransferZone- Parameters:
transferZoneGroup- to register as being part of
-
removeFromTransferZoneGroup
public boolean removeFromTransferZoneGroup(TransferZoneGroup transferZoneGroup)
remove from transfer zone group provided and also remove ths transfer zone from group provided- Specified by:
removeFromTransferZoneGroupin interfaceTransferZone- Parameters:
transferZoneGroup- to remove ourselves as member from- Returns:
- true when removal was successful, false otherwise
-
removeFromAllTransferZoneGroups
public void removeFromAllTransferZoneGroups()
remove this transfer zone from all groups it is registered on (and also update the group references- Specified by:
removeFromAllTransferZoneGroupsin interfaceTransferZone
-
getTransferZoneGroups
public final Set<TransferZoneGroup> getTransferZoneGroups()
All transfer zone groups the transfer zone resides in (unmodifiable)- Specified by:
getTransferZoneGroupsin interfaceTransferZone- Returns:
- transfer zone groups of the transfer zone
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable id- Specified by:
recreateManagedIdsin interfaceManagedId- Overrides:
recreateManagedIdsin classZoneImpl- Parameters:
tokenId- to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))- Returns:
- the updated internal id
-
shallowClone
public TransferZoneImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein interfaceTransferZone- Specified by:
shallowClonein interfaceZone- Specified by:
shallowClonein classZoneImpl- Returns:
- shallow copy of entity
-
deepClone
public TransferZoneImpl 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
-
-