Class Intersection<V>
- java.lang.Object
-
- oracle.spatial.network.nfe.model.spatial.interaction.Intersection<V>
-
- Type Parameters:
V- The type of elements in the intersection
- All Implemented Interfaces:
java.lang.Cloneable
public class Intersection<V> extends java.lang.Object implements java.lang.CloneableRepresents an intersection between two or more elements.
-
-
Constructor Summary
Constructors Constructor Description Intersection(java.awt.geom.Point2D interPoint, double tolerance)Allocates a new intersection
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMember(IntersectionMember<V> member)Adds a member to the intersectionjava.lang.Objectclone()booleancontainsMember(IntersectionMember<V> member)Tells whether an intersection member belongs to the current intersectionlonggetId()Gets the intersection IDjava.awt.geom.Point2DgetIntersectionPoint()Gets the spatial point where the intersection occurredIntersectionMember<V>getMember(long memId)Gets a member identified by the given IDjava.util.Collection<IntersectionMember<V>>getMembers()Gets all the members of the intersectionjava.util.Collection<IntersectionMember<V>>getMembers(int geomType)Gets all the members with the given geometry typeintgetMembersCount()Gets the number of elements participating in the intersectionprotected static longgetNextId()IntersectionMember<V>getOwner()Gets the member marked as intersection owner (if any)doublegetTolerance()Gets the tolerance used to detect the intersectionbooleanisOwner(IntersectionMember<V> member)Tells whether the given member is owner of the intersection.voidmarkAsOwner(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 typevoidremoveMember(IntersectionMember<V> member)Removes an intersection membervoidsetIntersectionPoint(java.awt.geom.Point2D interPoint)Sets the spatial point where the intersection occurredvoidsetTolerance(double tolerance)Sets the tolerance used to detect the intersection
-
-
-
Method Detail
-
getNextId
protected static long getNextId()
-
getId
public long getId()
Gets the intersection ID- Returns:
- the intersection ID
-
getMembersCount
public int getMembersCount()
Gets the number of elements participating in the intersection- Returns:
- the number of elements in the intersection
-
addMember
public void addMember(IntersectionMember<V> member)
Adds a member to the intersection- Parameters:
member- an intersection member
-
removeMember
public void removeMember(IntersectionMember<V> member)
Removes an intersection member- Parameters:
member- an intersection member
-
containsMember
public boolean containsMember(IntersectionMember<V> member)
Tells whether an intersection member belongs to the current intersection- Parameters:
member- an intersection member- Returns:
- true if it is a member of the intersection
-
getMembers
public java.util.Collection<IntersectionMember<V>> getMembers()
Gets all the members of the intersection- Returns:
- a collection of intersection members
-
markAsOwner
public void markAsOwner(IntersectionMember<V> member)
Sets the given member as the owner of the intersection. An intersection may not have an owner. An owner can be the element that creates the interaction, for example, an element that was added or that was moved.- Parameters:
member- a member of the intersection
-
isOwner
public boolean isOwner(IntersectionMember<V> member)
Tells whether the given member is owner of the intersection.- Parameters:
member- a member of the intersection- Returns:
- true if the element is the owner
-
getOwner
public IntersectionMember<V> getOwner()
Gets the member marked as intersection owner (if any)- Returns:
- an intersection member or null if the intersection has not owner member
-
getIntersectionPoint
public java.awt.geom.Point2D getIntersectionPoint()
Gets the spatial point where the intersection occurred- Returns:
- a java point
-
setIntersectionPoint
public void setIntersectionPoint(java.awt.geom.Point2D interPoint)
Sets the spatial point where the intersection occurred- Parameters:
interPoint- a java point
-
pickFirstMember
public IntersectionMember<V> pickFirstMember(int geomType)
Gets the first member found with the given geometry type- Parameters:
geomType- a geometry type- Returns:
- the first member found or null if no members were found
-
getMembers
public java.util.Collection<IntersectionMember<V>> getMembers(int geomType)
Gets all the members with the given geometry type- Parameters:
geomType- a geometry type- Returns:
- a collection of intersection members
-
getMember
public IntersectionMember<V> getMember(long memId)
Gets a member identified by the given ID- Parameters:
memId- an intersection member ID- Returns:
- an intersection member of null if the member was not found
-
getTolerance
public double getTolerance()
Gets the tolerance used to detect the intersection- Returns:
- a tolerance value
-
setTolerance
public void setTolerance(double tolerance)
Sets the tolerance used to detect the intersection- Parameters:
tolerance- a tolerance value
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException- Overrides:
clonein classjava.lang.Object- Throws:
java.lang.CloneNotSupportedException
-
-