Exemple #1
0
 private NodeType GetNodeType(IGraphProcessingEnvironment procEnv, SequenceExpression AdjacentNodeType)
 {
     NodeType nodeType = null;
     if(AdjacentNodeType != null)
     {
         object tmp = AdjacentNodeType.Evaluate(procEnv);
         if(tmp is string) nodeType = procEnv.Graph.Model.NodeModel.GetType((string)tmp);
         else if(tmp is NodeType) nodeType = (NodeType)tmp;
         if(nodeType == null) throw new Exception("node type argument to " + FunctionSymbol + " iteration is not a node type");
     }
     else
     {
         nodeType = procEnv.Graph.Model.NodeModel.RootType;
     }
     return nodeType;
 }
Exemple #2
0
 private EdgeType GetEdgeType(IGraphProcessingEnvironment procEnv, SequenceExpression IncidentEdgeType)
 {
     EdgeType edgeType = null;
     if(IncidentEdgeType != null)
     {
         object tmp = IncidentEdgeType.Evaluate(procEnv);
         if(tmp is string) edgeType = procEnv.Graph.Model.EdgeModel.GetType((string)tmp);
         else if(tmp is EdgeType) edgeType = (EdgeType)tmp;
         if(edgeType == null) throw new Exception("edge type argument to " + FunctionSymbol + " iteration is not an edge type");
     }
     else
     {
         edgeType = procEnv.Graph.Model.EdgeModel.RootType;
     }
     return edgeType;
 }