Class AbstractNode
java.lang.Object
it.univr.di.cstnu.graph.AbstractComponent
it.univr.di.cstnu.graph.AbstractNode
- All Implemented Interfaces:
Component, Node, Serializable, Comparable<Component>
- Direct Known Subclasses:
LabeledNode
Base class for implementing Node.
- Version:
- $Rev: 1130 $
- Author:
- posenato
- See Also:
-
Field Summary
Fields 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
ConstructorsConstructorDescriptionMinimal constructor.AbstractNode(Node node) Constructor to clone the component.Simplified constructor -
Method Summary
Methods inherited from class AbstractComponent
addObserver, clear, compareTo, equals, equalsByName, getName, hashCode, inNegativeCycle, isNameManagedByGraph, markNameManagedByGraph, removeObserver, renameInternal, setInNegativeCycle, takeIn, toStringModifier and TypeMethodDescriptionfinal voidaddObserver(String propertyName, PropertyChangeListener l) An observer for the property.voidclear()Clear all components but the name.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 voidtoString()Return a string representation of labeled values.Methods inherited from interface Node
isContingent, isParameter, newInstance, newInstance, newInstanceModifier and TypeMethodDescriptiondefault booleandefault booleanFactorynewInstance(Node node) Any super-interfaces/implementing classes should ensure that such a method has an Edge node as an argument!newInstance(String name) Factory
-
Constructor Details
-
AbstractNode
public AbstractNode()Minimal constructor.- See Also:
-
AbstractNode
-
AbstractNode
AbstractNode(Node node) Constructor to clone the component.- Parameters:
node- the component to clone.
-
-
Method Details
-
setName
Sets the name of the node.Once this node has been added to a graph, its name is managed by that graph: use
TemporalConstraintGraph.renameNode(this, newName)instead of calling this method directly.- Specified by:
setNamein interfaceComponent- Specified by:
setNamein classAbstractComponent- Parameters:
newName- cannot empty. If empty, it does nothing.- Returns:
- the old name.
- Throws:
IllegalStateException- if this node's name is already managed by a graph.
-
takeIn
-