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:
Cloneable
,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 transferZoneImpl)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToTransferZoneGroup(TransferZoneGroup transferZoneGroup)
register this transfer zone group as a group this transfer zone is part ofTransferZoneImpl
clone()
Create a shallow copy of this entityprotected static long
generateTransferZoneId(IdGroupingToken tokenId)
generate unique od zone idSet<TransferZoneGroup>
getTransferZoneGroups()
All transfer zone groups the transfer zone resides in (unmodifiable)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 specificallyTransferZoneType
getTransferZoneType()
collect the type of this transfer zoneboolean
hasTransferZoneGroup()
Verify if a transfer zone is part of one or more transfer zone groupsboolean
isInTransferZoneGroup(TransferZoneGroup transferZoneGroup)
Verify if transfer zone is part of passed in transfer zone grouplong
recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable idvoid
removeFromAllTransferZoneGroups()
remove this transfer zone from all groups it is registered on (and also update the group referencesboolean
removeFromTransferZoneGroup(TransferZoneGroup transferZoneGroup)
remove from transfer zone group provided and also remove ths transfer zone from group providedprotected void
setTransferZoneId(long transferZoneId)
Set transfer zone Idvoid
setType(TransferZoneType type)
set the type of this transfer zone-
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
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
getExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, 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
getTransferZoneIdClass
-
Methods inherited from interface org.goplanit.utils.zoning.Zone
addInputProperty, getCentroid, getEnvelope, 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 transferZoneImpl)
Copy constructor- Parameters:
transferZoneImpl
- to copy
-
-
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:
getTransferZoneId
in interfaceTransferZone
- Returns:
- transfer zone specific id
-
setType
public void setType(TransferZoneType type)
set the type of this transfer zone- Specified by:
setType
in interfaceTransferZone
- Parameters:
type
- to set
-
getTransferZoneType
public TransferZoneType getTransferZoneType()
collect the type of this transfer zone- Specified by:
getTransferZoneType
in 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:
hasTransferZoneGroup
in 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:
isInTransferZoneGroup
in 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:
addToTransferZoneGroup
in 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:
removeFromTransferZoneGroup
in 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:
removeFromAllTransferZoneGroups
in interfaceTransferZone
-
getTransferZoneGroups
public final Set<TransferZoneGroup> getTransferZoneGroups()
All transfer zone groups the transfer zone resides in (unmodifiable)- Specified by:
getTransferZoneGroups
in 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:
recreateManagedIds
in interfaceManagedId
- Overrides:
recreateManagedIds
in classZoneImpl
- Parameters:
tokenId
- to use- Returns:
- the updated internal id
-
clone
public TransferZoneImpl clone()
Create a shallow copy of this entity
-
-