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 protectedCentroidImpl(IdGroupingToken groupId)ConstructorprotectedCentroidImpl(IdGroupingToken groupId, Zone parentZone)ConstructorprotectedCentroidImpl(CentroidImpl other, boolean deepCopy)Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CentroidImpldeepClone()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 longgenerateId(IdGroupingToken tokenId)Generate id for instances of this class based on the token and class identifierStringgetName()The name of the centroidZonegetParentZone()Return the parent zone of this centroidorg.locationtech.jts.geom.PointgetPosition()Position of the centroidlongrecreateManagedIds(IdGroupingToken tokenId)recreate the internal id(s) and set them including the Idable idvoidsetName(String name)Set the name of the centroidvoidsetParentZone(Zone parentZone)Set the parent zonevoidsetPosition(org.locationtech.jts.geom.Point position)Set the Position of the centroidCentroidImplshallowClone()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:
shallowClonein interfaceCentroid- Specified by:
shallowClonein interfaceIdAble- Specified by:
shallowClonein 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:
recreateManagedIdsin 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:
getParentZonein interfaceCentroid- Returns:
- parent zone of this centroid
-
setParentZone
public void setParentZone(Zone parentZone)
Set the parent zone- Specified by:
setParentZonein 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:
getPositionin interfaceCentroid- Returns:
- the position
-
setPosition
public void setPosition(org.locationtech.jts.geom.Point position)
Set the Position of the centroid- Specified by:
setPositionin interfaceCentroid- Parameters:
position- to use
-
-