Class ZoneImpl

    • Field Detail

      • name

        protected String name
        name of the zone
      • inputProperties

        protected Map<String,​Object> inputProperties
        generic input property storage
      • centroid

        protected Centroid centroid
        Centroid of the zone
      • geometry

        protected org.locationtech.jts.geom.Geometry geometry
        geometry of this zone
    • Constructor Detail

      • ZoneImpl

        public ZoneImpl​(IdGroupingToken tokenId)
        Constructor
        Parameters:
        tokenId - contiguous id generation within this group for instances of this class
      • ZoneImpl

        public ZoneImpl​(ZoneImpl other,
                        boolean deepCopy)
        Constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • generateZoneId

        protected static long generateZoneId​(IdGroupingToken groupId)
        Generate unique id for this zone
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        Returns:
        id for this zone
      • setCentroid

        protected void setCentroid​(Centroid centroid)
        set the centroid for this zone. It is assumed the centroid is correctly configured to be compatible with this zoneImpl
        Parameters:
        centroid - to set
      • setId

        protected void setId​(long id)
        set the zone's unique internal id across all zones
        Overrides:
        setId in class IdAbleImpl
        Parameters:
        id - to set
      • getCentroid

        public Centroid getCentroid()
        Returns the centroid of this zone
        Specified by:
        getCentroid in interface Zone
        Returns:
        centroid of this zone
      • setGeometry

        public void setGeometry​(org.locationtech.jts.geom.Geometry geometry)
        set the geometry (outer border) of this zone, can be a polygon, but also a line string
        Specified by:
        setGeometry in interface Zone
        Parameters:
        geometry - of the zone
      • getGeometry

        public org.locationtech.jts.geom.Geometry getGeometry()
        Collect the geometry (outer border) of this zone
        Specified by:
        getGeometry in interface Zone
        Returns:
        geometry of the zone
      • getName

        public String getName()
        Name of the zone
        Specified by:
        getName in interface Zone
        Returns:
        name of the zone
      • setName

        public void setName​(String name)
        Name of the zone
        Specified by:
        setName in interface Zone
        Parameters:
        name - of the zone
      • addInputProperty

        public void addInputProperty​(String key,
                                     Object value)
        Add a property from the original input that is not part of the readily available members
        Specified by:
        addInputProperty in interface Zone
        Parameters:
        key - key (name) of the input property
        value - value of the input property
      • getInputProperty

        public Object getInputProperty​(String key)
        collect a property
        Specified by:
        getInputProperty in interface Zone
        Parameters:
        key - for the property
        Returns:
        property itself
      • 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 (may be null in case managed id entity does not rely on token to recreate its managed id(s))
        Returns:
        the updated internal id
      • deepClone

        public abstract ZoneImpl 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
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in interface Zone
        Overrides:
        deepClone in class ExternalIdAbleImpl
        Returns:
        deep copy of entity