Package org.goplanit.utils.zoning
Interface TransferZoneGroup
-
- All Superinterfaces:
Cloneable
,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_CLASS
the class to use for the id generation
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description TransferZone
addTransferZone(TransferZone transferZone)
Add a transferZone and also register this group on this transfer zone at the same timeTransferZoneGroup
clone()
Create a shallow copy of this entitydefault TransferZone
getFirst()
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.String
getName()
Name of the groupCollection<TransferZone>
getTransferZones()
create a view of the registered transfer zones.default boolean
hasName()
Verify if the group has a name alreadyboolean
hasTransferZone(TransferZone transferZone)
Verify if transfer zone is presentdefault boolean
hasTransferZones()
verify if groups has any transfer zones registereddefault boolean
isEmpty()
check if no transfer zones are registeredTransferZone
removeTransferZone(TransferZone transferZone)
remove a transfer zone from the group, and also remove the reference on the transfer zone at the same timevoid
setName(String name)
set Name of the groupint
size()
Number of registered transfer zones-
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 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)
-
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
-
clone
TransferZoneGroup clone()
Create a shallow copy of this entity
-
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:
getIdClass
in interfaceManagedId
- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
-