Package org.goplanit.utils.zoning
Interface TransferZoneGroup
-
- All Superinterfaces:
Comparable<IdAble>,ExternalIdAble,IdAble,Iterable<TransferZone>,ManagedId
- All Known Implementing Classes:
TransferZoneGroupImpl
public interface TransferZoneGroup extends ExternalIdAble, ManagedId, Iterable<TransferZone>
A group of transfer zones, can be used to represent for example train stations.- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static Class<TransferZoneGroup>TRANSFER_ZONE_GROUP_ID_CLASSthe class to use for the id generation
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidaddAllTransferZones(Collection<TransferZone> transferZonesToAdd)Add all transferZones providedTransferZoneaddTransferZone(TransferZone transferZone)Add a transferZone and also register this group on this transfer zone at the same timeTransferZoneGroupdeepClone()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.default TransferZonegetFirst()Collect first transfer zone that would be returned by the iteratordefault Class<TransferZoneGroup>getIdClass()Each managed id class is expected to generate its ids based on its class signature.StringgetName()Name of the groupCollection<TransferZone>getTransferZones()create a view of the registered transfer zones.default booleanhasName()Verify if the group has a name alreadybooleanhasTransferZone(TransferZone transferZone)Verify if transfer zone is presentdefault booleanhasTransferZones()verify if groups has any transfer zones registereddefault booleanisEmpty()check if no transfer zones are registeredTransferZoneremoveTransferZone(TransferZone transferZone)remove a transfer zone from the group, and also remove the reference on the transfer zone at the same timevoidsetName(String name)set Name of the groupTransferZoneGroupshallowClone()Create a shallow copy of this entityintsize()Number of registered transfer zones-
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 java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
recreateManagedIds, resetChildManagedIdEntities
-
-
-
-
Field Detail
-
TRANSFER_ZONE_GROUP_ID_CLASS
static final Class<TransferZoneGroup> TRANSFER_ZONE_GROUP_ID_CLASS
the class to use for the id generation
-
-
Method Detail
-
getName
String getName()
Name of the group- Returns:
- name
-
setName
void setName(String name)
set Name of the group- Parameters:
name- to set
-
addTransferZone
TransferZone addTransferZone(TransferZone transferZone)
Add a transferZone and also register this group on this transfer zone at the same time- Parameters:
transferZone- to add- Returns:
- previousTransferZone under same id (if any)
-
addAllTransferZones
default void addAllTransferZones(Collection<TransferZone> transferZonesToAdd)
Add all transferZones provided- Parameters:
transferZonesToAdd- to add
-
removeTransferZone
TransferZone removeTransferZone(TransferZone transferZone)
remove a transfer zone from the group, and also remove the reference on the transfer zone at the same time- Parameters:
transferZone- to remove- Returns:
- removed transfer zone
-
hasTransferZone
boolean hasTransferZone(TransferZone transferZone)
Verify if transfer zone is present- Parameters:
transferZone- to check- Returns:
- true when present, false otherwise
-
size
int size()
Number of registered transfer zones- Returns:
- number of registered transfer zones
-
getTransferZones
Collection<TransferZone> getTransferZones()
create a view of the registered transfer zones. Any changes are reflected in the group as well- Returns:
- registered transfer zones
-
shallowClone
TransferZoneGroup shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClonein interfaceIdAble- Returns:
- shallow copy of entity
-
deepClone
TransferZoneGroup 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
-
getFirst
default TransferZone getFirst()
Collect first transfer zone that would be returned by the iterator- Returns:
- transfer zone
-
isEmpty
default boolean isEmpty()
check if no transfer zones are registered- Returns:
- true when empty false otherwise
-
hasName
default boolean hasName()
Verify if the group has a name already- Returns:
- true when non-null, non-blank name is present, false otherwise
-
hasTransferZones
default boolean hasTransferZones()
verify if groups has any transfer zones registered- Returns:
- true when present false otherwise
-
getIdClass
default Class<TransferZoneGroup> 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:
getIdClassin interfaceManagedId- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
-