Class NFERulesModel
- java.lang.Object
-
- oracle.spatial.network.nfe.model.rule.NFERulesModel
-
- All Implemented Interfaces:
java.util.EventListener,NFEModelListener
public class NFERulesModel extends java.lang.Object implements NFEModelListener
NFE component used as a holder and manager of rules. Components interested on events related to rules instances should be subscribed to the NFERulesModels as NFEModelListeners.
-
-
Field Summary
-
Fields inherited from interface oracle.spatial.network.nfe.model.event.NFEModelListener
METHOD_MODEL_OBJECT_ADDED, METHOD_MODEL_OBJECT_REMOVED, METHOD_MODEL_OBJECTS_ADDED, METHOD_MODEL_OBJECTS_REMOVED, METHOD_PROPERTY_CHANGED
-
-
Constructor Summary
Constructors Constructor Description NFERulesModel(NFEModel model)Creates a new instance of NFERulesModel
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCardinalityRule(NFECardinalityRule cardRule)Adds a cardinality rule to the rules modelvoidaddCardinalityRules(java.util.Collection<NFECardinalityRule> cardRules)Adds all the cardinality rules to the rules modelvoidaddConnectivityRules(java.util.Collection<? extends NFEConnectivityRule> rules)Adds all the connectivity rules to the rules model.voidaddLineLineRule(NFELineLineRule llRule)Adds a line-line rule to the rules modelvoidaddLinePointRule(NFELinePointRule lpRule)Adds a line-point rule to the rules modelvoidaddModelListener(NFEModelListener listener)Subscribes a model listener to receive events about rule instancesbooleanaddRuleInstance(NFERuleInstance ruleInstance)Adds a new rule instance to the rule modelNFECardinalityRulegetCardinalityRule(NFEFeatureClass featClass)Gets cardinality rule applicable for the given feature classjava.util.Collection<NFECardinalityRule>getCardinalityRules()Gets all the cardinality rules contained in the rules modelNFEEventDispatcher<NFEModelListener>getEventDispatcher()java.util.Collection<NFELineLineRule>getLineLineRules()Gets all the line-line rules contained in the rules modeljava.util.Collection<NFELinePointRule>getLinePointRules()Gets all the line-point rules contained in the rules modelNFEModelgetModel()Gets the NFE model associated to the rules modelNFERuleInstancegetRuleInstance(long ruleInstanceId)Gets the rule instance identified by the given idjava.util.Collection<NFERuleInstance>getRuleInstances(NFEFeatureElement featElem)Gets all the rule instances associated to the given feature elementjava.util.Collection<NFERuleInstance>getRuleInstances(NFEFeatureElement featElem, NFEConnectivityRule.ConnectivityRuleType type)Gets all the rule instances associated to the given feature element and created by a connectivity rule of the specified typevoidmodelObjectAdded(NFEModelObjectEvent event)Invoked when a model object has been addedvoidmodelObjectPropertyChanged(NFEModelObjectPropertyChangedEvent event)Invoked when a model object's property has been changedvoidmodelObjectRemoved(NFEModelObjectEvent event)Invoked when a model object has been removedvoidmodelObjectsAdded(NFEModelObjectsEvent event)Invoked when one or more model objects have been addedvoidmodelObjectsRemoved(NFEModelObjectsEvent event)Invoked when one or more model objects have been removedprotected voidnotifyModelObjectAdded(java.lang.Object modelObject)protected voidnotifyModelObjectRemoved(java.lang.Object modelObject)booleanremoveCardinalityRule(NFECardinalityRule cardRule)Removes a cardinality rule from the modelbooleanremoveLineLineRule(NFELineLineRule llRule)Removes the given line-line rulebooleanremoveLinePointRule(NFELinePointRule lpRule)Removes the given line-point rule from the modelvoidremoveModelListener(NFEModelListener listener)Removes a model listenerNFERuleInstanceremoveRuleInstance(long ruleInstanceId)Removes from the rules model the rule instance identified by the given idvoidsetEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)voidtransferRuleInstances(NFEFeatureElement srcFeatElem, NFEFeatureElement dstFeatElem)Associates to dstFeatElem all the rule instances associated to srcFeatElem.
-
-
-
Constructor Detail
-
NFERulesModel
public NFERulesModel(NFEModel model)
Creates a new instance of NFERulesModel- Parameters:
model- the current NFE model
-
-
Method Detail
-
getModel
public NFEModel getModel()
Gets the NFE model associated to the rules model- Returns:
- an NFE model instance
-
addConnectivityRules
public void addConnectivityRules(java.util.Collection<? extends NFEConnectivityRule> rules)
Adds all the connectivity rules to the rules model.- Parameters:
rules- a collection containing connectivity rule implementations
-
addLinePointRule
public void addLinePointRule(NFELinePointRule lpRule)
Adds a line-point rule to the rules model- Parameters:
lpRule- a line-point rule
-
removeLinePointRule
public boolean removeLinePointRule(NFELinePointRule lpRule)
Removes the given line-point rule from the model- Parameters:
lpRule- a line-point rule- Returns:
- true if the rule could be removed
-
getLinePointRules
public java.util.Collection<NFELinePointRule> getLinePointRules()
Gets all the line-point rules contained in the rules model- Returns:
- a collection containing line-point rules
-
addLineLineRule
public void addLineLineRule(NFELineLineRule llRule)
Adds a line-line rule to the rules model- Parameters:
llRule- a line-line rule
-
getLineLineRules
public java.util.Collection<NFELineLineRule> getLineLineRules()
Gets all the line-line rules contained in the rules model- Returns:
- a line-line rule
-
removeLineLineRule
public boolean removeLineLineRule(NFELineLineRule llRule)
Removes the given line-line rule- Parameters:
llRule- a line-line rule from the model- Returns:
- true if the rule could be removed
-
addCardinalityRules
public void addCardinalityRules(java.util.Collection<NFECardinalityRule> cardRules)
Adds all the cardinality rules to the rules model- Parameters:
cardRules- a collection containing cardinality rules
-
addCardinalityRule
public void addCardinalityRule(NFECardinalityRule cardRule)
Adds a cardinality rule to the rules model- Parameters:
cardRule- a cardinality rule
-
getCardinalityRules
public java.util.Collection<NFECardinalityRule> getCardinalityRules()
Gets all the cardinality rules contained in the rules model- Returns:
- a collection containing cardinality rules
-
getCardinalityRule
public NFECardinalityRule getCardinalityRule(NFEFeatureClass featClass)
Gets cardinality rule applicable for the given feature class- Parameters:
featClass- a feature class- Returns:
- a cardinality rule or null if the feature class does not have any cardinality rule
-
removeCardinalityRule
public boolean removeCardinalityRule(NFECardinalityRule cardRule)
Removes a cardinality rule from the model- Parameters:
cardRule- a cardinality rule- Returns:
- true if the rule could be removed
-
addRuleInstance
public boolean addRuleInstance(NFERuleInstance ruleInstance)
Adds a new rule instance to the rule model- Parameters:
ruleInstance- a rule instance- Returns:
- true if the rule could be added to the model
-
removeRuleInstance
public NFERuleInstance removeRuleInstance(long ruleInstanceId)
Removes from the rules model the rule instance identified by the given id- Parameters:
ruleInstanceId- a rule instance id- Returns:
- true if the rule instance could be removed
-
getRuleInstance
public NFERuleInstance getRuleInstance(long ruleInstanceId)
Gets the rule instance identified by the given id- Parameters:
ruleInstanceId- a rule instance id- Returns:
- a rule instance
-
getRuleInstances
public java.util.Collection<NFERuleInstance> getRuleInstances(NFEFeatureElement featElem)
Gets all the rule instances associated to the given feature element- Parameters:
featElem- a feature element- Returns:
- a collection of rule instances
-
getRuleInstances
public java.util.Collection<NFERuleInstance> getRuleInstances(NFEFeatureElement featElem, NFEConnectivityRule.ConnectivityRuleType type)
Gets all the rule instances associated to the given feature element and created by a connectivity rule of the specified type- Parameters:
featElem- a feature elementtype- a connectivity rule type- Returns:
- a collection of rule instances
-
addModelListener
public void addModelListener(NFEModelListener listener)
Subscribes a model listener to receive events about rule instances- Parameters:
listener- a model listener implementation
-
removeModelListener
public void removeModelListener(NFEModelListener listener)
Removes a model listener- Parameters:
listener- a model listener implementation
-
notifyModelObjectAdded
protected void notifyModelObjectAdded(java.lang.Object modelObject)
-
notifyModelObjectRemoved
protected void notifyModelObjectRemoved(java.lang.Object modelObject)
-
setEventDispatcher
public void setEventDispatcher(NFEEventDispatcher<NFEModelListener> eventDispatcher)
-
getEventDispatcher
public NFEEventDispatcher<NFEModelListener> getEventDispatcher()
-
modelObjectAdded
public void modelObjectAdded(NFEModelObjectEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object has been added- Specified by:
modelObjectAddedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model object that has been added
-
modelObjectsAdded
public void modelObjectsAdded(NFEModelObjectsEvent event)
Description copied from interface:NFEModelListenerInvoked when one or more model objects have been added- Specified by:
modelObjectsAddedin interfaceNFEModelListener- Parameters:
event- contains a collection of references to the model objects that have been added
-
modelObjectRemoved
public void modelObjectRemoved(NFEModelObjectEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object has been removed- Specified by:
modelObjectRemovedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model object that has been removed
-
modelObjectsRemoved
public void modelObjectsRemoved(NFEModelObjectsEvent event)
Description copied from interface:NFEModelListenerInvoked when one or more model objects have been removed- Specified by:
modelObjectsRemovedin interfaceNFEModelListener- Parameters:
event- contains a collection of references to the model objects that have been removed
-
modelObjectPropertyChanged
public void modelObjectPropertyChanged(NFEModelObjectPropertyChangedEvent event)
Description copied from interface:NFEModelListenerInvoked when a model object's property has been changed- Specified by:
modelObjectPropertyChangedin interfaceNFEModelListener- Parameters:
event- contains a reference to the model objects which property has been changed and the name and previous value of the changed property
-
transferRuleInstances
public void transferRuleInstances(NFEFeatureElement srcFeatElem, NFEFeatureElement dstFeatElem)
Associates to dstFeatElem all the rule instances associated to srcFeatElem. Also removes the associations with srcFeatElem- Parameters:
srcFeatElem- the feature element from which the rule instances want to be moveddstFeatElem- the feature element which will be associated to the rule instances
-
-