Class CSTNPSUEdgePluggable
java.lang.Object
it.univr.di.cstnu.graph.AbstractComponent
it.univr.di.cstnu.graph.AbstractEdge
it.univr.di.cstnu.graph.CSTNEdgePluggable
it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
it.univr.di.cstnu.graph.CSTNPSUEdgePluggable
- All Implemented Interfaces:
BasicCSTNUEdge, Component, CSTNEdge, CSTNPSUEdge, Edge, Serializable, Comparable<Component>
An implementation of CSTNPSUEdge.
This edge differs from the CSTNU edge because it also admits that lower-case values are propagated and that it is possible to have lower-case values with conjoined lower-case labels.
This edge differs from the CSTNU edge because it also admits that lower-case values are propagated and that it is possible to have lower-case values with conjoined lower-case labels.
- Version:
- $Rev: 1153 $
- Author:
- posenato
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicCSTNUEdgePluggable
BasicCSTNUEdgePluggable.InternalEntryModifier and TypeClassDescription(package private) static final classRepresents a pair (Label, String).Nested classes/interfaces inherited from interface Edge
Edge.ConstraintType -
Field Summary
FieldsModifier and TypeFieldDescription(package private) it.unimi.dsi.fastutil.objects.Object2IntMap<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label, ALabel>> The CSTNU controllability check algorithm needs to know if a labeled value has already been considered in the past to avoid adding it a second time.(package private) LabeledALabelIntTreeMapMorris Lower case value augmented by a propositional label.Fields inherited from class BasicCSTNUEdgePluggable
consideredUpperCaseValue, upperCaseValueModifier and TypeFieldDescription(package private) it.unimi.dsi.fastutil.objects.Object2IntMap<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label, ALabel>> The CSTNU controllability check algorithm needs to know if a labeled value has already been considered in the past to avoid adding it a second time.(package private) LabeledALabelIntTreeMapMorris Upper case value augmented by a propositional label.Fields inherited from class CSTNEdgePluggable
consideredLabeledValue, DEFAULT_LABELED_INT_MAP_CLASS, labeledValue, labeledValueMapImpl, LOGModifier and TypeFieldDescription(package private) it.unimi.dsi.fastutil.objects.Object2IntMap<Label> Maintains the log of labeled values that have already been inserted and, therefore, cannot be reinserted.(package private) static final Class<? extends LabeledIntMap> Default class for representing labeled values.(package private) LabeledIntMapLabeled value.(package private) final Class<? extends LabeledIntMap> Labeled value class used in the class.(package private) static LoggerloggerFields inherited from class AbstractEdge
constraintTypeFields inherited from class AbstractComponent
name, pcsModifier and TypeFieldDescription(package private) StringPossible name(package private) PropertyChangeSupportSince Java 9, Observable has no longer been supported. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Constructor to clone the component. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all components but the name.voidClears the labeled lowercase values.final voidClears the labeled lowercase values.it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> Don't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.it.unimi.dsi.fastutil.objects.ObjectSet<Label> it.unimi.dsi.fastutil.objects.ObjectSet<Label> getLabelsOfLowerCaseValues(ALabel aLabel) it.unimi.dsi.fastutil.objects.ObjectSet<ALabel> intgetLowerCaseValue(Label l, ALabel name1) final it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> Don't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> getLowerCaseValues(ALabel lowerCaseLabel) it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<ALabel>> final booleanbooleanThis method is inappropriate here, but it helps to speed up the code.booleanisEmpty()final intfinal booleanmergeLabeledValue(Label l, int i) Merges the labeled value i into the set of labeled values of this edge.final booleanmergeLowerCaseValue(Label l, ALabel nodeName, int i) Merge a lower label constraint with valueifor the node namenwith labell.FactorynewInstance(Edge edge) Any super-interfaces/implementing classes should ensure that such a method has the edge as an argument!newInstance(String name1) Factoryfinal voidputLowerCaseValue(Label l, ALabel nodeName, int i) Set or add a lower label constraint with delay i for the node n with label l.final voidremoveLowerCaseValue(Label l, ALabel n) voidsetLowerCaseValues(LabeledALabelIntTreeMap lowerCaseValue1) voidA copy by reference of the internal structure of edge e.Methods inherited from class BasicCSTNUEdgePluggable
clearUpperCaseValues, getAllUpperCaseAndLabeledValues, getLabelsOfUpperCaseValues, getLabelsOfUpperCaseValues, getMinUpperCaseValue, getMinUpperCaseValue, getUpperCaseLabels, getUpperCaseValue, getUpperCaseValues, getUpperCaseValues, mergeUpperCaseValue, putLabeledValue, putUpperCaseValue, removeUpperCaseValue, setUpperCaseValueMap, size, toString, upperCaseValuesAsString, upperCaseValueSizeModifier and TypeMethodDescriptionfinal voidClears all uppercase labeled values.final it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> Don't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.it.unimi.dsi.fastutil.objects.ObjectSet<Label> final it.unimi.dsi.fastutil.objects.ObjectSet<Label> getLabelsOfUpperCaseValues(ALabel aLabel) final it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<ALabel>> final it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label> getMinUpperCaseValue(ALabel upperCaseLabel) final it.unimi.dsi.fastutil.objects.ObjectSet<ALabel> final intgetUpperCaseValue(Label l, ALabel name1) final it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> Don't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.final it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> getUpperCaseValues(ALabel aLabel) Don't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.final booleanmergeUpperCaseValue(Label l, ALabel nodeName, int i) Merge an upper label constraint with delayifor the node name n with propositional labell.final booleanputLabeledValue(Label l, int i) final booleanputUpperCaseValue(Label l, ALabel nodeName, int i) Put an upper label constraint with delay i for the node name n with label l.final intremoveUpperCaseValue(Label l, ALabel n) Remove the upper label for node name n with label l.final voidsetUpperCaseValueMap(LabeledALabelIntTreeMap inputLabeledValue) intsize()final StringtoString()Return a string representation of labeled values.hfinal Stringfinal intMethods inherited from class CSTNEdgePluggable
getLabeledIntMapImplClass, getLabeledValues, getLabelsOfLabeledValues, getMinLabeledValue, getMinValue, getMinValueSubsumedBy, getValue, isCSTNEdge, labeledValuesAsString, mergeLabeledValue, mergeLabeledValues, removeLabeledValue, setLabeledValueMapModifier and TypeMethodDescriptionfinal Class<? extends LabeledIntMap> final it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> it.unimi.dsi.fastutil.objects.ObjectSet<Label> final it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label> intfinal intfinal intbooleanThis method is inappropriate here, but it helps to speed up the code.final StringbooleanmergeLabeledValue(String ls, int i) Wrapper method forCSTNEdge.mergeLabeledValue(Label, int).voidfinal voidRemove the value labeled by l from the map.final voidsetLabeledValueMap(LabeledIntMap inputLabeledValue) Uses inputLabeledValue as an internal labeled value map.Methods inherited from class AbstractEdge
getConstraintType, getRoute, isCSTNUEdge, isOSTNUEdge, isSTNEdge, isSTNUEdge, setConstraintType, setName, setRouteModifier and TypeMethodDescriptionfinal Edge.ConstraintTypefinal EdgeRoutegetRoute()booleanThis method is inappropriate here, but it helps to speed up the code.booleanThis method is inappropriate here, but it helps to speed up the code.booleanThis method is inappropriate here, but it helps to speed up the code.booleanThis method is inappropriate here, but it helps to speed up the code.final voidfinal StringSets the name of the edge.final voidSets the explicit routing of this edge, ornullto return the edge to automatic.Methods inherited from class AbstractComponent
addObserver, compareTo, equals, equalsByName, getName, hashCode, inNegativeCycle, isNameManagedByGraph, markNameManagedByGraph, removeObserver, renameInternal, setInNegativeCycle, takeInModifier and TypeMethodDescriptionfinal voidaddObserver(String propertyName, PropertyChangeListener l) An observer for the property.final intImplements the natural order of the component names.booleanDeprecated.final booleanA component is assumed to be equal to another if it has the same name.final StringgetName()final inthashCode()final boolean(package private) final boolean(package private) final voidfinal voidremoveObserver(String propertyName, PropertyChangeListener listener) Removes a specific listener(package private) final voidrenameInternal(String newName) Sets the name without validation or notification.final voidsetInNegativeCycle(boolean isInNegativeCycle) Sets true if the edge is in a negative cyclefinal voidMethods inherited from interface Edge
isContingentEdge, isRequirementEdgeModifier and TypeMethodDescriptiondefault booleandefault boolean
-
Field Details
-
consideredLowerCaseValue
-
lowerCaseValues
LabeledALabelIntTreeMap lowerCaseValuesMorris Lower case value augmented by a propositional label.The name of the node has to be equal to the original name. No case modifications are necessary!
-
-
Constructor Details
-
CSTNPSUEdgePluggable
CSTNPSUEdgePluggable()Default constructor. Empty edge. -
CSTNPSUEdgePluggable
CSTNPSUEdgePluggable(String n) - Parameters:
n- name of edge
-
CSTNPSUEdgePluggable
-
-
Method Details
-
clear
public void clear()Description copied from class:CSTNEdgePluggableClear all components but the name.Clear (remove) all labeled values associated with this edge.
- Specified by:
clearin interfaceComponent- Overrides:
clearin classBasicCSTNUEdgePluggable
-
clearLowerCaseValue
public void clearLowerCaseValue()Description copied from interface:BasicCSTNUEdgeClears the labeled lowercase values. For CSTNU, there is always only one value, but for some extensions, it can be more.- Specified by:
clearLowerCaseValuein interfaceBasicCSTNUEdge
-
clearLowerCaseValues
public final void clearLowerCaseValues()Description copied from interface:CSTNPSUEdgeClears the labeled lowercase values.- Specified by:
clearLowerCaseValuesin interfaceCSTNPSUEdge
-
getAllLowerCaseAndLabeledValues
public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> getAllLowerCaseAndLabeledValues()Description copied from interface:CSTNPSUEdgeDon't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.- Specified by:
getAllLowerCaseAndLabeledValuesin interfaceCSTNPSUEdge- Returns:
- the set of all labeled values and all labeled lower-case ones. The labeled values have an empty ALabel.
-
getLabelsOfLowerCaseValues
public it.unimi.dsi.fastutil.objects.ObjectSet<Label> getLabelsOfLowerCaseValues(@Nonnull ALabel aLabel) - Specified by:
getLabelsOfLowerCaseValuesin interfaceCSTNPSUEdge- Parameters:
aLabel- the lower-case label- Returns:
- the set of all labels associated with lower-case label aLabel.
-
getLabelsOfLowerCaseValues
- Specified by:
getLabelsOfLowerCaseValuesin interfaceCSTNPSUEdge- Returns:
- the set of all labels associated with all lower-case labeled values;
-
getLowerCaseLabels
- Specified by:
getLowerCaseLabelsin interfaceCSTNPSUEdge- Returns:
- the set of all lower-case labels.
-
getLowerCaseValue
- Specified by:
getLowerCaseValuein interfaceCSTNPSUEdge- Parameters:
l- aLabelobject.name1- aALabelnode name.- Returns:
- the labeled lower-case value.
Constants.INT_NULLif the value does not exist.
-
getLowerCaseValues
public final it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> getLowerCaseValues()Description copied from interface:CSTNPSUEdgeDon't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.- Specified by:
getLowerCaseValuesin interfaceCSTNPSUEdge- Returns:
- the set of all labeled lower-case values.
-
setLowerCaseValues
- Specified by:
setLowerCaseValuesin interfaceCSTNPSUEdge- Parameters:
lowerCaseValue1- the labeled lower case value to use for initializing the current one.
-
getLowerCaseValues
@NonNull public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> getLowerCaseValues(@Nonnull ALabel lowerCaseLabel) - Specified by:
getLowerCaseValuesin interfaceCSTNPSUEdge- Parameters:
lowerCaseLabel- a non-null lower-case label.- Returns:
- a view of the lower-case values associated with lowerCaseLabel if there are some of them, an empty set otherwise.
-
getMinLowerCaseValue
@Nullable public it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<ALabel>> getMinLowerCaseValue()- Specified by:
getMinLowerCaseValuein interfaceCSTNPSUEdge- Returns:
- a copy of the minimal value (with the ALabel) among all upper-case labeled values if there are some of them, null otherwise.
-
hasSameValues
- Specified by:
hasSameValuesin interfaceEdge- Overrides:
hasSameValuesin classBasicCSTNUEdgePluggable- Parameters:
e- the other edge- Returns:
- true if it has the same values.
-
isCSTNPSUEdge
public boolean isCSTNPSUEdge()Description copied from interface:EdgeThis method is inappropriate here, but it helps to speed up the code.- Specified by:
isCSTNPSUEdgein interfaceEdge- Overrides:
isCSTNPSUEdgein classAbstractEdge- Returns:
- true if the edge is a CSTNPSU edge
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceEdge- Overrides:
isEmptyin classBasicCSTNUEdgePluggable- Returns:
- true if it does not contain any values
-
lowerCaseValueAsString
- Specified by:
lowerCaseValueAsStringin interfaceBasicCSTNUEdge- Returns:
- the representation of the lower-case value(s) of the edge.
-
lowerCaseValueSize
public final int lowerCaseValueSize()- Specified by:
lowerCaseValueSizein interfaceBasicCSTNUEdge- Returns:
- the number of lower-case value(s) of the edge.
-
mergeLabeledValue
Description copied from class:CSTNEdgePluggableMerges the labeled value i into the set of labeled values of this edge.Merges the labeled value i into the set of labeled values of this edge.
- Specified by:
mergeLabeledValuein interfaceCSTNEdge- Overrides:
mergeLabeledValuein classBasicCSTNUEdgePluggable- Parameters:
l- aLabelobject.i- the new weight.- Returns:
- true if the operation was successful, false otherwise.
-
mergeLowerCaseValue
Description copied from interface:CSTNPSUEdgeMerge a lower label constraint with valueifor the node namenwith labell.- Specified by:
mergeLowerCaseValuein interfaceCSTNPSUEdge- Parameters:
l- It cannot be null or empty.nodeName- the node name. It cannot be null. It must be the unmodified name of the node.i- It cannot be null.- Returns:
- true if the merge has been successful.
-
newInstance
Description copied from interface:EdgeFactory- Specified by:
newInstancein interfaceEdge- Overrides:
newInstancein classCSTNEdgePluggable- Returns:
- an object of type Edge.
-
newInstance
Description copied from interface:EdgeAny super-interfaces/implementing classes should ensure that such a method has the edge as an argument!- Specified by:
newInstancein interfaceEdge- Overrides:
newInstancein classCSTNEdgePluggable- Parameters:
edge- an object to clone.- Returns:
- an object of type Edge.
-
newInstance
Description copied from interface:EdgeFactory- Specified by:
newInstancein interfaceEdge- Overrides:
newInstancein classCSTNEdgePluggable- Parameters:
name1- of the edge- Returns:
- an object of type Edge.
-
putLowerCaseValue
Description copied from interface:BasicCSTNUEdgeSet or add a lower label constraint with delay i for the node n with label l.If a value with a lower-case nodeName and label l for node n is already present, it is overwritten.
- Specified by:
putLowerCaseValuein interfaceBasicCSTNUEdge- Parameters:
l- the labelnodeName- the node name. It cannot be null.i- the new value
-
removeLowerCaseValue
- Specified by:
removeLowerCaseValuein interfaceCSTNPSUEdge- Parameters:
l- aLabelobject.n- aALabelnode name
-
takeIn
-