Class TransferZoneGroupImpl

    • Field Detail

      • transferZoneMap

        protected Map<Long,​TransferZone> transferZoneMap
        Map storing all the transfer zones in the group
      • name

        protected String name
        name of the transfer zone group
    • Constructor Detail

      • TransferZoneGroupImpl

        protected TransferZoneGroupImpl​(IdGroupingToken tokenId)
        Constructor
        Parameters:
        tokenId - to use
      • TransferZoneGroupImpl

        public TransferZoneGroupImpl​(TransferZoneGroupImpl transferZoneGroupImpl)
        Copy constructor
        Parameters:
        transferZoneGroupImpl - to copy
    • Method Detail

      • recreateTransferZoneIdMapping

        protected void recreateTransferZoneIdMapping()
        recreate the mapping such that all the keys used for each transfer zone reflect their internal id. To be called whenever the ids of transfer zones are changed
      • generateTransferZoneGroupId

        protected static long generateTransferZoneGroupId​(IdGroupingToken tokenId)
        generate unique transfer zone group id
        Parameters:
        tokenId - contiguous id generation within this group for instances of this class
        Returns:
        odZoneId
      • setName

        public void setName​(String name)
        set Name of the group
        Specified by:
        setName in interface TransferZoneGroup
        Parameters:
        name - to set
      • addTransferZone

        public TransferZone addTransferZone​(TransferZone transferZone)
        Add a transferZone and also register this group on this transfer zone at the same time
        Specified by:
        addTransferZone in interface TransferZoneGroup
        Parameters:
        transferZone - to add
        Returns:
        previousTransferZone under same id (if any)
      • removeTransferZone

        public TransferZone removeTransferZone​(TransferZone transferZone)
        remove a transfer zone from the group, and also remove the reference on the transfer zone at the same time
        Specified by:
        removeTransferZone in interface TransferZoneGroup
        Parameters:
        transferZone - to remove
        Returns:
        removed transfer zone
      • hasTransferZone

        public boolean hasTransferZone​(TransferZone transferZone)
        Verify if transfer zone is present
        Specified by:
        hasTransferZone in interface TransferZoneGroup
        Parameters:
        transferZone - to check
        Returns:
        true when present, false otherwise
      • size

        public int size()
        Number of registered transfer zones
        Specified by:
        size in interface TransferZoneGroup
        Returns:
        number of registered transfer zones
      • recreateManagedIds

        public long recreateManagedIds​(IdGroupingToken tokenId)
        recreate the internal id(s) and set them including the Idable id
        Specified by:
        recreateManagedIds in interface ManagedId
        Parameters:
        tokenId - to use
        Returns:
        the updated internal id