コード例 #1
0
 /**
  * Excludes the given GraphElementClass and all its subclasses.
  *
  * @param processed marks already processed Elements.
  * @param currentGraphElementClass the GraphElementClass to exclude.
  */
 private void excludeGraphElementClass(
     LocalBooleanGraphMarker processed, EdgeClass currentGraphElementClass) {
   processed.mark(currentGraphElementClass);
   includes.removeMark(currentGraphElementClass);
   for (SpecializesEdgeClass_superEdgeClass current :
       currentGraphElementClass.getSpecializesEdgeClass_superEdgeClassIncidences()) {
     EdgeClass superclass = (EdgeClass) current.getThat();
     excludeGraphElementClass(processed, superclass);
   }
 }
コード例 #2
0
  /** Excludes all EdgeClasses that have an excluded to or from VertexClass. */
  private void excludeUnecessaryEdgeClasses() {
    for (EdgeClass currentEdgeClass : schemaGraph.getEdgeClassVertices()) {
      if (includes.isMarked(currentEdgeClass)) {
        // only look at included EdgeClasses
        IncidenceClass fromIC = null;
        IncidenceClass toIC = null;
        for (ConnectsToEdgeClass_connectedEdgeClass inc :
            currentEdgeClass.getConnectsToEdgeClass_connectedEdgeClassIncidences()) {
          IncidenceClass ic = (IncidenceClass) inc.getThat();
          if (ic.get_direction() == Direction.EDGE_TO_VERTEX) toIC = ic;
          if (ic.get_direction() == Direction.VERTEX_TO_EDGE) fromIC = ic;
        }

        VertexClass fromVC = (VertexClass) fromIC.getFirst_incidenceClassAtVertex().getThat();
        VertexClass toVC = (VertexClass) toIC.getFirst_incidenceClassAtEdge().getThat();
        if (!includes.isMarked(fromVC) || !includes.isMarked(toVC)) {
          // exclude all EdgeClasses whose to or from VertexClasses
          // are already excluded
          includes.removeMark(currentEdgeClass);
        }
      }
    }
  }