Class NESTGraphValidatorImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.data.object.nest.utils.impl.NESTGraphValidatorImpl
-
- All Implemented Interfaces:
NESTGraphValidator
- Direct Known Subclasses:
NESTSequentialWorkflowValidatorImpl,NESTWorkflowValidatorImpl
public class NESTGraphValidatorImpl extends Object implements NESTGraphValidator
Implementation of theNESTGraphValidator.- Author:
- Alexander Schultheis
-
-
Field Summary
Fields Modifier and Type Field Description protected StringerrorMessageprotected BooleanisValidGraphprotected org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description NESTGraphValidatorImpl(NESTGraphObject graphObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetErrorMessage()This method outputs the collected error messages from previous methods as a String.NESTGraphObjectgetGraph()This method returns the graph object for which the validator was created.protected Set<String>getUniqueEdgeIDs()protected Set<String>getUniqueNodeIDs()booleanhasFullyConnectedAndNoDuplicateEdges()This method checks that all edges have connections and that no edge is duplicated.booleanhasUniqueEdgeIDs()This method checks if all edges in the graph have unique Ids.booleanhasUniqueNodeIDs()This method checks if all nodes in the graph have unique Ids.booleanhasValidSemanticDescriptors()booleanisValidGraph()This method checks whether the graph is a valid nest graph.protected voidlog(String msg)voidreset()The method resets all values stored in the validator.
-
-
-
Constructor Detail
-
NESTGraphValidatorImpl
public NESTGraphValidatorImpl(NESTGraphObject graphObject)
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:NESTGraphValidatorThe method resets all values stored in the validator. This method is to be used when changes have been made to the graph object after validation by the validator.- Specified by:
resetin interfaceNESTGraphValidator
-
isValidGraph
public boolean isValidGraph()
Description copied from interface:NESTGraphValidatorThis method checks whether the graph is a valid nest graph. This is true if the graph has unique ids for nodes and edges and all edges are unique and connected. See methodsNESTGraphValidator.hasUniqueEdgeIDs(),NESTGraphValidator.hasUniqueNodeIDs()andNESTGraphValidator.hasFullyConnectedAndNoDuplicateEdges().- Specified by:
isValidGraphin interfaceNESTGraphValidator- Returns:
- True, if graph is valid.
-
hasUniqueEdgeIDs
public boolean hasUniqueEdgeIDs()
Description copied from interface:NESTGraphValidatorThis method checks if all edges in the graph have unique Ids.- Specified by:
hasUniqueEdgeIDsin interfaceNESTGraphValidator- Returns:
- True, if all edge ids are unique.
-
hasUniqueNodeIDs
public boolean hasUniqueNodeIDs()
Description copied from interface:NESTGraphValidatorThis method checks if all nodes in the graph have unique Ids.- Specified by:
hasUniqueNodeIDsin interfaceNESTGraphValidator- Returns:
- True, if all node ids are unique.
-
hasFullyConnectedAndNoDuplicateEdges
public boolean hasFullyConnectedAndNoDuplicateEdges()
Description copied from interface:NESTGraphValidatorThis method checks that all edges have connections and that no edge is duplicated.- Specified by:
hasFullyConnectedAndNoDuplicateEdgesin interfaceNESTGraphValidator- Returns:
- True, if all edges are valid.
-
hasValidSemanticDescriptors
public boolean hasValidSemanticDescriptors()
- Specified by:
hasValidSemanticDescriptorsin interfaceNESTGraphValidator
-
getErrorMessage
public String getErrorMessage()
Description copied from interface:NESTGraphValidatorThis method outputs the collected error messages from previous methods as a String.- Specified by:
getErrorMessagein interfaceNESTGraphValidator- Returns:
- A string containing all error messages. If the string is null, the graph was valid for all previous checks.
-
log
protected void log(String msg)
-
getGraph
public NESTGraphObject getGraph()
Description copied from interface:NESTGraphValidatorThis method returns the graph object for which the validator was created.- Specified by:
getGraphin interfaceNESTGraphValidator- Returns:
- The graph object for which the validator was created.
-
-