Class NFEMemoryRuleHandlerContext
- java.lang.Object
-
- oracle.spatial.network.nfe.model.rule.handler.NFEMemoryRuleHandlerContext
-
- All Implemented Interfaces:
NFERuleHandlerContext
public class NFEMemoryRuleHandlerContext extends java.lang.Object implements NFERuleHandlerContext
In-memory implementation of a rule handler context. Internally it uses the current NFE model instance to perform most of its tasks.
-
-
Constructor Summary
Constructors Constructor Description NFEMemoryRuleHandlerContext(NFEModel model, NFEConnectivityRule rule)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanconnectionExists(NFEFeatureElement featElem1, NFEFeatureElement featElem2)Tells whether the given feature elements are connected.NFEConnectableEdge<NFEFeatureElement>createConnectableEdge(NFEFeatureElement lineFeatElem, java.awt.geom.Point2D connPoint, IntersectionLocation connInterLoc)Creates a new connectable edge which will be used by a connection descriptor.NFEConnectionDescriptor<NFEFeatureElement,NFEFeatureElement>createConnectionDescriptor()Creates a new connection descriptor instanceNFERuleHandlerContextcreateContext(NFELinePointRule lpRule)Creates a new nested context for the line-point rule.NFELinePointRuleHandlerParamcreateLeftHandLinePointHandlerParam(NFELineLineRuleHandlerParam llhParam)Creates a new parameter for a line-line rule's left hand side line-point ruleNFELinePointRuleHandlerParamcreateRighttHandLinePointHandlerParam(NFELineLineRuleHandlerParam llhParam)Creates a new parameter for a line-line rule's right hand side line-point ruleint[]getAvailableConnections(NFEFeatureElement pointFeatElem)Gets the number of available connections for the given point feature element.NFERuleHandlergetHandler(NFEConnectivityRule rule)Gets the handler assigned to the given connectivity ruleintgetSRID()Gets the current NFE model's SRIDint[]getUsedConnections(NFEFeatureElement pointFeatElem, long lineFeatLayerId, long lineFeatClassId)Gets the number of in an out connections the given point contains with lines of the specified feature layer and feature class.booleaninConnectionExists(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)Tells whether the line feature element is an incoming connection of the point feature elementbooleanisStandaloneFeatureElement(NFEFeatureElement featElem)Thells whether the feature element is standalone.booleanoutConnectionExists(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)Tells whether the line feature element is an outgoing connection of the point feature elementNFEFeatureElementrequestDefaultPointFeatureElement(JGeometry pointGeom)Creates a new standalone point feature element with the given point geometry.booleanreserveInConnection(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)Creates a virtual in connection between the point and line feature element.booleanreserveOutConnection(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)Creates a virtual out connection between the point and line feature element.voidreset()Resets the state of the context
-
-
-
Constructor Detail
-
NFEMemoryRuleHandlerContext
public NFEMemoryRuleHandlerContext(NFEModel model, NFEConnectivityRule rule)
-
-
Method Detail
-
getAvailableConnections
public int[] getAvailableConnections(NFEFeatureElement pointFeatElem)
Description copied from interface:NFERuleHandlerContextGets the number of available connections for the given point feature element. The number of available connections are calculated based on the cardinality defined for the point's feature class. Virtual connections made by the handler are considered as actual connections.- Specified by:
getAvailableConnectionsin interfaceNFERuleHandlerContext- Parameters:
pointFeatElem- a point feature element- Returns:
- a two-element array with the number of available in and out connections at the position 0 and 1 respectively
-
getUsedConnections
public int[] getUsedConnections(NFEFeatureElement pointFeatElem, long lineFeatLayerId, long lineFeatClassId)
Description copied from interface:NFERuleHandlerContextGets the number of in an out connections the given point contains with lines of the specified feature layer and feature class. Virtual connections performed by the handler are considered.- Specified by:
getUsedConnectionsin interfaceNFERuleHandlerContext- Returns:
- a two-element array with the number of used in and out connections at the position 0 and 1 respectively
-
connectionExists
public boolean connectionExists(NFEFeatureElement featElem1, NFEFeatureElement featElem2)
Description copied from interface:NFERuleHandlerContextTells whether the given feature elements are connected. A Line and point are considered connected when their underlying link and node are connected. Points are considered connected if they are connected to the same underlying link. Lines are considered connected if they are connected to the same underlying node.- Specified by:
connectionExistsin interfaceNFERuleHandlerContext- Parameters:
featElem1- a feature elementfeatElem2- a feature element- Returns:
- true if the elements are connected
-
inConnectionExists
public boolean inConnectionExists(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)
Description copied from interface:NFERuleHandlerContextTells whether the line feature element is an incoming connection of the point feature element- Specified by:
inConnectionExistsin interfaceNFERuleHandlerContext- Parameters:
pointFeatElem- a point feature elementlineFeatElem- a line feature element- Returns:
- true if the line is an in-connection
-
outConnectionExists
public boolean outConnectionExists(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)
Description copied from interface:NFERuleHandlerContextTells whether the line feature element is an outgoing connection of the point feature element- Specified by:
outConnectionExistsin interfaceNFERuleHandlerContext- Parameters:
pointFeatElem- a point feature elementlineFeatElem- a line feature element- Returns:
- true if the line is an out-connection
-
getHandler
public NFERuleHandler getHandler(NFEConnectivityRule rule)
Description copied from interface:NFERuleHandlerContextGets the handler assigned to the given connectivity rule- Specified by:
getHandlerin interfaceNFERuleHandlerContext- Parameters:
rule- a connectivity rule object- Returns:
- a rule handler instance
-
reserveInConnection
public boolean reserveInConnection(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)
Description copied from interface:NFERuleHandlerContextCreates a virtual in connection between the point and line feature element. A virtual connection only exists in the handler context. No rule handler can see virtual connections made by another handler, unless, the contexts are nested due to nested handler calls.- Specified by:
reserveInConnectionin interfaceNFERuleHandlerContext- Parameters:
pointFeatElem- a point feature elementlineFeatElem- a line feature element- Returns:
- true if the virtual connection could be performed.
-
reserveOutConnection
public boolean reserveOutConnection(NFEFeatureElement pointFeatElem, NFEFeatureElement lineFeatElem)
Description copied from interface:NFERuleHandlerContextCreates a virtual out connection between the point and line feature element. A virtual connection only exists in the handler context. No rule handler can see virtual connections made by another handler, unless, the contexts are nested due to nested handler calls.- Specified by:
reserveOutConnectionin interfaceNFERuleHandlerContext- Parameters:
pointFeatElem- a point feature elementlineFeatElem- a line feature element- Returns:
- true if the virtual connection could be performed.
-
requestDefaultPointFeatureElement
public NFEFeatureElement requestDefaultPointFeatureElement(JGeometry pointGeom)
Description copied from interface:NFERuleHandlerContextCreates a new standalone point feature element with the given point geometry. The new only can be created if the handler's rule is allowed to create a default point. The characteristics of the new point such as feature layer and feature class are also given by the handler's rule. The created point is considered standalone, that is, it is not included in any of the model's feature layers.- Specified by:
requestDefaultPointFeatureElementin interfaceNFERuleHandlerContext- Parameters:
pointGeom- a point geometry- Returns:
- a new standalone point feature element or null if the rule does not specify the creation of a default point
-
isStandaloneFeatureElement
public boolean isStandaloneFeatureElement(NFEFeatureElement featElem)
Description copied from interface:NFERuleHandlerContextThells whether the feature element is standalone. A feature element is standalone if it is not included in any of the model's feature layers- Specified by:
isStandaloneFeatureElementin interfaceNFERuleHandlerContext- Parameters:
featElem- a feature element- Returns:
- true if the feature element is standalone
-
reset
public void reset()
Description copied from interface:NFERuleHandlerContextResets the state of the context- Specified by:
resetin interfaceNFERuleHandlerContext
-
getSRID
public int getSRID()
Description copied from interface:NFERuleHandlerContextGets the current NFE model's SRID- Specified by:
getSRIDin interfaceNFERuleHandlerContext- Returns:
- an srid
-
createContext
public NFERuleHandlerContext createContext(NFELinePointRule lpRule)
Description copied from interface:NFERuleHandlerContextCreates a new nested context for the line-point rule. The new context will be able to see information from the current context.- Specified by:
createContextin interfaceNFERuleHandlerContext- Parameters:
lpRule- a line-point rule object- Returns:
- a new handler context
-
createConnectionDescriptor
public NFEConnectionDescriptor<NFEFeatureElement,NFEFeatureElement> createConnectionDescriptor()
Description copied from interface:NFERuleHandlerContextCreates a new connection descriptor instance- Specified by:
createConnectionDescriptorin interfaceNFERuleHandlerContext- Returns:
- a feature element connection descriptor instance
-
createConnectableEdge
public NFEConnectableEdge<NFEFeatureElement> createConnectableEdge(NFEFeatureElement lineFeatElem, java.awt.geom.Point2D connPoint, IntersectionLocation connInterLoc)
Description copied from interface:NFERuleHandlerContextCreates a new connectable edge which will be used by a connection descriptor.- Specified by:
createConnectableEdgein interfaceNFERuleHandlerContext- Parameters:
lineFeatElem- a line feature elementconnPoint- the point on the line where the line will be connectedconnInterLoc- the location of the line where the connection will be performed- Returns:
- a new connectable edge
-
createLeftHandLinePointHandlerParam
public NFELinePointRuleHandlerParam createLeftHandLinePointHandlerParam(NFELineLineRuleHandlerParam llhParam)
Description copied from interface:NFERuleHandlerContextCreates a new parameter for a line-line rule's left hand side line-point rule- Specified by:
createLeftHandLinePointHandlerParamin interfaceNFERuleHandlerContext- Parameters:
llhParam- a line-line rule handler parameter object- Returns:
- a new line-point rule handler parameter
-
createRighttHandLinePointHandlerParam
public NFELinePointRuleHandlerParam createRighttHandLinePointHandlerParam(NFELineLineRuleHandlerParam llhParam)
Description copied from interface:NFERuleHandlerContextCreates a new parameter for a line-line rule's right hand side line-point rule- Specified by:
createRighttHandLinePointHandlerParamin interfaceNFERuleHandlerContext- Parameters:
llhParam- a line-line rule handler parameter object- Returns:
- a new line-point rule handler parameter
-
-