Package org.goplanit.zoning
Class CentroidImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.zoning.CentroidImpl
-
- All Implemented Interfaces:
Serializable
,Comparable<IdAble>
,IdAble
,ManagedId
,Centroid
public class CentroidImpl extends IdAbleImpl implements Centroid
Centroid implementation- Author:
- gman6028, markr
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.goplanit.utils.zoning.Centroid
CENTROID_ID_CLASS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
CentroidImpl(IdGroupingToken groupId)
Constructorprotected
CentroidImpl(IdGroupingToken groupId, Zone parentZone)
Constructorprotected
CentroidImpl(CentroidImpl other, boolean deepCopy)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.protected static long
generateId(IdGroupingToken tokenId)
Generate id for instances of this class based on the token and class identifierString
getName()
The name of the centroidZone
getParentZone()
Return the parent zone of this centroidorg.locationtech.jts.geom.Point
getPosition()
Position of the centroidlong
recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable idvoid
setName(String name)
Set the name of the centroidvoid
setParentZone(Zone parentZone)
Set the parent zonevoid
setPosition(org.locationtech.jts.geom.Point position)
Set the Position of the centroidCentroidImpl
shallowClone()
Create a shallow copy of this entity-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.zoning.Centroid
getIdClass, hasName, hasPosition
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
resetChildManagedIdEntities
-
-
-
-
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 classparentZone
- The parent zone of this Centroid
-
CentroidImpl
protected CentroidImpl(CentroidImpl other, boolean deepCopy)
Copy constructor- Parameters:
other
- to copydeepCopy
- 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
-
shallowClone
public CentroidImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceCentroid
- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in classIdAbleImpl
- Returns:
- shallow copy of entity
-
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
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable id- Specified by:
recreateManagedIds
in interfaceManagedId
- 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 interfaceCentroid
- Returns:
- parent zone of this centroid
-
setParentZone
public void setParentZone(Zone parentZone)
Set the parent zone- Specified by:
setParentZone
in interfaceCentroid
- Parameters:
parentZone
- to set
-
getName
public String getName()
The name of the centroid
-
setName
public void setName(String name)
Set the name of the centroid
-
getPosition
public org.locationtech.jts.geom.Point getPosition()
Position of the centroid- Specified by:
getPosition
in interfaceCentroid
- Returns:
- the position
-
setPosition
public void setPosition(org.locationtech.jts.geom.Point position)
Set the Position of the centroid- Specified by:
setPosition
in interfaceCentroid
- Parameters:
position
- to use
-
-