Examples of Vertex


Examples of org.codehaus.plexus.graph.Vertex

                            Edge e,
                            Visitor visitor )
    {
        visitor.discoverEdge( e );

        Vertex v = graph.getTarget( e );

        if ( getColor( v ) == WHITE )
        {
            visitVertex( graph, v, visitor );
        }
View Full Code Here

Examples of org.codehaus.plexus.util.dag.Vertex

        Set projectsToMake = new HashSet( Arrays.asList( selectedProjects ) );
        for ( int i = 0; i < selectedProjects.length; i++ )
        {
            MavenProject project = selectedProjects[i];
            String id = ArtifactUtils.versionlessKey( project.getGroupId(), project.getArtifactId() );
            Vertex v = dag.getVertex( id );
            if ( make )
            {
                gatherDescendents ( v, projectMap, projectsToMake, new HashSet() );
            }
            if ( makeDependents )
View Full Code Here

Examples of org.cx4a.rsense.typing.vertex.Vertex

                        if (receiver instanceof Hash) {
                            if (args != null && args.length > 0) {
                                Hash hash = (Hash) receiver;
                                Object key = Hash.getRealKey(args[0].getNode());
                                if (!hash.isModified() && key != null) {
                                    Vertex v = hash.get(key);
                                    if (v != null) {
                                        ts.addAll(v.getTypeSet());
                                    }
                                }
                            }
                        } else if (receiver instanceof Array) {
                            if (args != null && args.length > 0) {
                                Array array = (Array) receiver;
                                Integer n = Vertex.getFixnum(args[0]);
                                if (!array.isModified() && n != null) {
                                    Vertex v = array.getElement(n);
                                    if (v != null) {
                                        ts.addAll(v.getTypeSet());
                                    }
                                }
                            }
                        } else if (receiver instanceof Proc) {
                            if (arg == null) {
                                if (args == null) {
                                    arg = Arrays.asList((IRubyObject) RuntimeHelper.createArray(Graph.this, new Vertex[0]));
                                } else if (args.length == 1) {
                                    arg = args[0].getTypeSet();
                                } else { arg = Arrays.asList((IRubyObject) RuntimeHelper.createArray(Graph.this, args));
                                }
                            }
                            Vertex returnVertex = createFreeVertex();
                            RuntimeHelper.yield(Graph.this, (Proc) receiver, arg, true, returnVertex);
                            ts.addAll(returnVertex.getTypeSet());
                        }
                    }

                    if (ts.isEmpty()) {
                        result.setCallNextMethod(true);
                    } else {
                        result.setResultTypeSet(ts);
                    }
                }
            });

        addSpecialMethod("private", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    RuntimeHelper.setMethodsVisibility(Graph.this, receivers, args, Visibility.PRIVATE);
                }
            });

        addSpecialMethod("protected", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    RuntimeHelper.setMethodsVisibility(Graph.this, receivers, args, Visibility.PROTECTED);
                }
            });

        addSpecialMethod("public", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    RuntimeHelper.setMethodsVisibility(Graph.this, receivers, args, Visibility.PUBLIC);
                }
            });

        addSpecialMethod("module_function", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    RuntimeHelper.setMethodsVisibility(Graph.this, receivers, args, Visibility.MODULE_FUNCTION);
                }
            });

        addSpecialMethod("attr", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    if (args != null && args.length > 0) {
                        RuntimeHelper.defineAttrs(Graph.this, receivers, new Vertex[] { args[0] }, true, args.length > 1);
                    }
                }
            });

        addSpecialMethod("attr_reader", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    RuntimeHelper.defineAttrs(Graph.this, receivers, args, true, false);
                }
            });

        addSpecialMethod("attr_writer", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    RuntimeHelper.defineAttrs(Graph.this, receivers, args, false, true);
                }
            });

        addSpecialMethod("attr_accessor", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    RuntimeHelper.defineAttrs(Graph.this, receivers, args, true, true);
                }
            });

        addSpecialMethod("alias_method", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    boolean callNextMethod = true;
                    if (args != null && args.length == 2) {
                        for (IRubyObject receiver : receivers) {
                            if (receiver instanceof RubyModule) {
                                callNextMethod = false;
                                String newName = Vertex.getStringOrSymbol(args[0]);
                                String oldName = Vertex.getStringOrSymbol(args[1]);
                                if (newName != null && oldName != null) {
                                    RubyModule module = (RubyModule) receiver;
                                    DynamicMethod method = module.getMethod(oldName);
                                    if (method instanceof Method)
                                        module.addMethod(newName, new AliasMethod(newName, (Method) method));
                                }
                            }
                        }
                    }
                    result.setCallNextMethod(callNextMethod);
                }
            });
       
        addSpecialMethod("unpack", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    if (args != null && args.length > 0) {
                        String template = Vertex.getString(args[0]);
                        if (template != null) {
                            TypeSet ts = new TypeSet();
                            for (IRubyObject object : receivers) {
                                if (object.isKindOf(runtime.getString())) {
                                    List<Vertex> elements = new ArrayList<Vertex>();
                                    for (char c : template.toCharArray()) {
                                        RubyClass type = null;
                                        switch (c) {
                                        case 'a': case 'A': case 'Z': case 'b':
                                        case 'B': case 'h': case 'H': case 'm':
                                        case 'M': case 'p': case 'P': case 'u':
                                        case 'U':
                                            type = runtime.getString();
                                            break;
                                        case 'c': case 'C': case 's': case 'S':
                                        case 'i': case 'I': case 'l': case 'L':
                                        case 'q': case 'Q': case 'n': case 'N':
                                        case 'v': case 'V': case 'w': case 'x':
                                        case 'X':
                                            type = runtime.getInteger();
                                            break;
                                        case 'f': case 'd': case 'e': case 'E':
                                        case 'g': case 'G':
                                            type = runtime.getFloat();
                                            break;
                                        }
                                        if (type != null) {
                                            elements.add(createFreeSingleTypeVertex(newInstanceOf(type)));
                                        }
                                    }
                                    ts.add(RuntimeHelper.createArray(Graph.this, elements.toArray(new Vertex[0])));
                                }
                            }
                            if (ts.isEmpty()) {
                                result.setCallNextMethod(true);
                            } else {
                                result.setResultTypeSet(ts);
                            }
                        }
                    }
                }
            });

        addSpecialMethod("proc", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    TypeSet ts = new TypeSet();
                    for (IRubyObject receiver : receivers) {
                        DynamicMethod method = receiver.getMetaClass().searchMethod("proc");
                        if (method != null && method.getModule() == runtime.getKernel()) {
                            if (block instanceof Proc)
                                ts.add((Proc) block);
                            else
                                Logger.debug("proc for no block is not supported yet");
                        }
                    }
                    if (ts.isEmpty())
                        result.setCallNextMethod(true);
                    else
                        result.setResultTypeSet(ts);
                }
            });

        addSpecialMethod("lambda", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    TypeSet ts = new TypeSet();
                    for (IRubyObject receiver : receivers) {
                        DynamicMethod method = receiver.getMetaClass().searchMethod("lambda");
                        if (method != null && method.getModule() == runtime.getKernel()) {
                            if (block instanceof Proc)
                                ts.add((Proc) block);
                            else
                                Logger.debug("lambda for no block is not supported yet");
                        }
                    }
                    if (ts.isEmpty())
                        result.setCallNextMethod(true);
                    else
                        result.setResultTypeSet(ts);
                }
            });

        addSpecialMethod("call", new SpecialMethod() {
                public void call(Ruby runtime, TypeSet receivers, Vertex[] args, Block block, Result result) {
                    TypeSet ts = new TypeSet();
                    Vertex argVertex = null;
                    for (IRubyObject receiver : receivers) {
                        if (receiver instanceof Proc) {
                            if (argVertex == null) {
                                TypeSet argts;
                                if (args == null) {
                                    argts = new TypeSet();
                                    argts.add(RuntimeHelper.createArray(Graph.this, new Vertex[0]));
                                } else if (args.length == 1) {
                                    argts = args[0].getTypeSet();
                                } else {
                                    argts = new TypeSet();
                                    argts.add(RuntimeHelper.createArray(Graph.this, args));
                                }
                                argVertex = createFreeVertex(argts);
                                argVertex.markUnchanged();
                            }
                            YieldVertex vertex = new YieldVertex(null,
                                                                 RuntimeHelper.getFrameTemplate(runtime.getContext().getCurrentFrame()),
                                                                 (Proc) receiver,
                                                                 argVertex,
View Full Code Here

Examples of org.eclipse.uml2.uml.Vertex

  {
    ArrayList<Vertex> colCompleteVertices = new ArrayList<Vertex>();
    for(Vertex oVertex : m_colVertices)
    {
      colCompleteVertices.add(oVertex);
      Vertex oSuperVertex = oVertex.getContainer().getState();
      while(oSuperVertex != null)
      {
        if(!colCompleteVertices.contains(oSuperVertex))
          colCompleteVertices.add(oSuperVertex);
        oSuperVertex = oSuperVertex.getContainer().getState();
      }
    }
    return colCompleteVertices;
  }
View Full Code Here

Examples of org.impalaframework.graph.Vertex

        Assert.notNull(parent, "parent cannot be null");
        Assert.notNull(moduleDefinition, "moduleDefinition cannot be null");
       
        logger.info("With parent '" + parent + "', adding module: " + moduleDefinition);
       
        final Vertex parentVertex = getRequiredVertex(parent);
       
        ModuleDefinition parentDefinition = parentVertex.getModuleDefinition();
        parentDefinition.addChildModuleDefinition(moduleDefinition);
        moduleDefinition.setParentDefinition(parentDefinition);
       
        //now recursively add definitions
        List<Vertex> addedVertices = new ArrayList<Vertex>();
View Full Code Here

Examples of org.jboss.util.graph.Vertex

/*  47 */     super(name);
/*     */   }
/*     */
/*     */   public void visit()
/*     */   {
/*  53 */     Vertex parent = getParent(this);
/*  54 */     Set children = getChildren(this);
/*     */
/*  56 */     if (this.log.isTraceEnabled()) {
/*  57 */       this.log.trace("Structure visit, parent: " + parent + ", children: " + children);
/*     */     }
View Full Code Here

Examples of org.mt4j.util.math.Vertex

      float height = bounds.getHeightXY(TransformSpace.LOCAL);
      float upperLeftX = bounds.getVectorsLocal()[0].x;
      float upperLeftY = bounds.getVectorsLocal()[0].y;
      Vertex[] verts = returnComponent.getVerticesLocal();
      for (int i = 0; i < verts.length; i++) {
        Vertex vertex = verts[i];
        vertex.setTexCoordU((vertex.x-upperLeftX)/width);
        vertex.setTexCoordV((vertex.y-upperLeftY)/height);
        //System.out.println("TexU:" + vertex.getTexCoordU() + " TexV:" + vertex.getTexCoordV());
      }
      returnComponent.getGeometryInfo().updateTextureBuffer(returnComponent.isUseVBOs());
    }
    return returnComponent;
View Full Code Here

Examples of org.neo4j.collections.graphdb.Vertex

      return rels.hasNext();
    }

    @Override
    public Vertex next() {
      Vertex elem = getDb().getVertex(rels.next().getEndNode());
      return elem;
    }
View Full Code Here

Examples of org.openjgraph.model.Vertex

            comparator.setTable(negativesDegree);
            Collections.sort(negatives, comparator);
            Collections.reverse(negatives);

            Vertex maxPosV = positives.get(0);
            Vertex maxNegV = negatives.get(0);

            int posDegree = positivesDegree.get(maxPosV);
            int negDegree = negativesDegree.get(maxNegV);

            if (posDegree + negDegree == 0) {
                try {
                    solvedGraph.addEdge(maxPosV.getId(), maxNegV.getId(), posDegree);

                    positives.remove(maxPosV);
                    positivesDegree.remove(maxPosV);
                    negatives.remove(maxNegV);
                    negativesDegree.remove(maxNegV);
                } catch (VertexNotFoundException e) {
                    // on ajoute le sommet manquant... un tour pour rien
                    solvedGraph.addVertex(e.getVertex());
                }

            }
            else if (posDegree + negDegree > 0) {
                try {
                    solvedGraph.addEdge(maxPosV.getId(), maxNegV.getId(), -negDegree);
                    positivesDegree.remove(maxPosV);
                    positivesDegree.put(maxPosV, posDegree + negDegree);
                    negatives.remove(maxNegV);
                    negativesDegree.remove(maxNegV);
                } catch (VertexNotFoundException e) {
                    // on ajoute le sommet manquant... un tour pour rien
                    solvedGraph.addVertex(e.getVertex());
                }
            }
            else {
                try {
                    solvedGraph.addEdge(maxPosV.getId(), maxNegV.getId(), posDegree);
                    positivesDegree.remove(maxPosV);
                    positives.remove(maxPosV);
                    negativesDegree.remove(maxNegV);
                    negativesDegree.put(maxNegV, posDegree + negDegree);
View Full Code Here

Examples of org.opensphere.geometry.triangulation.model.Vertex

      qes.getVertices(false);
   
    int iV = 0;
    for (com.vividsolutions.jts.triangulate.quadedge.Vertex v : qeVertices) {
      this.coordinates.put(v.getCoordinate(), iV);
      this.vertices.put(iV, new Vertex(iV, v.getCoordinate()));
      iV++;
    }
   
    // border
    List<QuadEdge> qeFrameBorder = new ArrayList<QuadEdge>();
    List<QuadEdge> qeFrame = new ArrayList<QuadEdge>();
    List<QuadEdge> qeBorder = new ArrayList<QuadEdge>();

    for (QuadEdge qe : quadEdges) {
      if (qes.isFrameBorderEdge(qe)) {
        qeFrameBorder.add(qe);
      }
      if (qes.isFrameEdge(qe)) {
        qeFrame.add(qe);
      }
    }

    // border
    for (int j = 0 ; j < qeFrameBorder.size() ; j++) {
      QuadEdge q = qeFrameBorder.get(j);
      if (! qeFrame.contains(q)) {
        qeBorder.add(q);
      }
    }
   
    // deletion of exterior edges
    for (QuadEdge qe : qeFrame) {
      qes.delete(qe);
    }
   
    HashMap<QuadEdge, Double> qeDistances = new HashMap<QuadEdge, Double>();
    for (QuadEdge qe : quadEdges) {
      qeDistances.put(qe, qe.toLineSegment().getLength());
    }
       
    DoubleComparator dc = new DoubleComparator(qeDistances);
    TreeMap<QuadEdge, Double> qeSorted = new TreeMap<QuadEdge, Double>(dc);
    qeSorted.putAll(qeDistances);

    // edges creation
    int i = 0;
    for (QuadEdge qe : qeSorted.keySet()) {
      LineSegment s = qe.toLineSegment();
      s.normalize();
     
      Integer idS = this.coordinates.get(s.p0);
      Integer idD = this.coordinates.get(s.p1);
      Vertex oV = this.vertices.get(idS);
      Vertex eV = this.vertices.get(idD);
     
      Edge edge;
      if (qeBorder.contains(qe)) {
        oV.setBorder(true);
        eV.setBorder(true);
        edge = new Edge(i, s, oV, eV, true);
        if (s.getLength() < this.threshold) {
          this.shortLengths.put(i, edge);
        } else {
          this.lengths.put(i, edge);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.