Class CentroidImpl

    • Constructor Detail

      • CentroidImpl

        protected CentroidImpl​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
      • CentroidImpl

        protected CentroidImpl​(IdGroupingToken groupId,
                               Zone parentZone)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        parentZone - The parent zone of this Centroid
      • CentroidImpl

        protected CentroidImpl​(CentroidImpl other,
                               boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • generateId

        protected static long generateId​(IdGroupingToken tokenId)
        Generate id for instances of this class based on the token and class identifier
        Parameters:
        tokenId - to use
        Returns:
        generated id
      • deepClone

        public CentroidImpl 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 Centroid
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in class IdAbleImpl
        Returns:
        deep copy of entity
      • 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
      • getParentZone

        public Zone getParentZone()
        Return the parent zone of this centroid
        Specified by:
        getParentZone in interface Centroid
        Returns:
        parent zone of this centroid
      • setParentZone

        public void setParentZone​(Zone parentZone)
        Set the parent zone
        Specified by:
        setParentZone in interface Centroid
        Parameters:
        parentZone - to set
      • getName

        public String getName()
        The name of the centroid
        Specified by:
        getName in interface Centroid
        Returns:
        its name
      • setName

        public void setName​(String name)
        Set the name of the centroid
        Specified by:
        setName in interface Centroid
        Parameters:
        name - to use
      • getPosition

        public org.locationtech.jts.geom.Point getPosition()
        Position of the centroid
        Specified by:
        getPosition in interface Centroid
        Returns:
        the position
      • setPosition

        public void setPosition​(org.locationtech.jts.geom.Point position)
        Set the Position of the centroid
        Specified by:
        setPosition in interface Centroid
        Parameters:
        position - to use