V
- The type of elements in the intersectionpublic class Intersection<V>
extends java.lang.Object
implements java.lang.Cloneable
Constructor and Description |
---|
Intersection(java.awt.geom.Point2D interPoint,
double tolerance)
Allocates a new intersection
|
Modifier and Type | Method and Description |
---|---|
void |
addMember(IntersectionMember<V> member)
Adds a member to the intersection
|
java.lang.Object |
clone() |
boolean |
containsMember(IntersectionMember<V> member)
Tells whether an intersection member belongs to the current intersection
|
long |
getId()
Gets the intersection ID
|
java.awt.geom.Point2D |
getIntersectionPoint()
Gets the spatial point where the intersection occurred
|
IntersectionMember<V> |
getMember(long memId)
Gets a member identified by the given ID
|
java.util.Collection<IntersectionMember<V>> |
getMembers()
Gets all the members of the intersection
|
java.util.Collection<IntersectionMember<V>> |
getMembers(int geomType)
Gets all the members with the given geometry type
|
int |
getMembersCount()
Gets the number of elements participating in the intersection
|
IntersectionMember<V> |
getOwner()
Gets the member marked as intersection owner (if any)
|
double |
getTolerance()
Gets the tolerance used to detect the intersection
|
boolean |
isOwner(IntersectionMember<V> member)
Tells whether the given member is owner of the intersection.
|
void |
markAsOwner(IntersectionMember<V> member)
Sets the given member as the owner of the intersection.
|
IntersectionMember<V> |
pickFirstMember(int geomType)
Gets the first member found with the given geometry type
|
void |
removeMember(IntersectionMember<V> member)
Removes an intersection member
|
void |
setIntersectionPoint(java.awt.geom.Point2D interPoint)
Sets the spatial point where the intersection occurred
|
void |
setTolerance(double tolerance)
Sets the tolerance used to detect the intersection
|
public Intersection(java.awt.geom.Point2D interPoint, double tolerance)
interPoint
- the spatial point where the intersection happenedtolerance
- tolerance used to detect all the elements involved in the interactionpublic long getId()
public int getMembersCount()
public void addMember(IntersectionMember<V> member)
member
- an intersection memberpublic void removeMember(IntersectionMember<V> member)
member
- an intersection memberpublic boolean containsMember(IntersectionMember<V> member)
member
- an intersection memberpublic java.util.Collection<IntersectionMember<V>> getMembers()
public void markAsOwner(IntersectionMember<V> member)
member
- a member of the intersectionpublic boolean isOwner(IntersectionMember<V> member)
member
- a member of the intersectionpublic IntersectionMember<V> getOwner()
public java.awt.geom.Point2D getIntersectionPoint()
public void setIntersectionPoint(java.awt.geom.Point2D interPoint)
interPoint
- a java pointpublic IntersectionMember<V> pickFirstMember(int geomType)
geomType
- a geometry typepublic java.util.Collection<IntersectionMember<V>> getMembers(int geomType)
geomType
- a geometry typepublic IntersectionMember<V> getMember(long memId)
memId
- an intersection member IDpublic double getTolerance()
public void setTolerance(double tolerance)
tolerance
- a tolerance valuepublic java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException