Package vg.core.storableGraph

Examples of vg.core.storableGraph.StorableEdge


                if(bufVertex.getStorableId() == db_id_target) {
                  target = bufVertex;
                }
              }
              if(source != null && target != null) {
                StorableEdge e = new StorableEdge(db_id_edge, source, target, id_edge);
                listEdge.add(e);
                //attributes-----------------
                SQLiteStatement attrStatement = null;
           
                request = "select s2.db_id, s2.name, s2.value, s2.value_type " +
                          "from com_edge_attribute s1, attribute s2 " +
                          "where s1.db_id_edge = " + Integer.valueOf(db_id_edge).toString() + " and s2.db_id = s1.db_id_attribute;";
                attrStatement = connection.prepare(request,false);
                while(attrStatement.step()) {
                  int db_id_attr = attrStatement.columnInt(0);
                  String db_name = attrStatement.columnString(1);
                  String db_value = attrStatement.columnString(2);
                  String db_type = attrStatement.columnString(3);
                  e.addStorableAttribute(new StorableAttribute(db_id_attr, db_name, db_value, db_type));
                }
                attrStatement.dispose();

              } else {
                VisualGraph.log.printError("[" + this.getClass().getName() + ".getStorableGraph] [BAD] Source edge = null || target edge = null.(" + db_id_source + "," + db_id_target + ")");
View Full Code Here


              if(bufVertex.getStorableId() == db_id_target) {
                target = bufVertex;
              }
            }
            if(source != null && target != null) {
              StorableEdge e = new StorableEdge(db_id_edge, source, target, id_edge);
              listEdge.add(e);
              //attributes-----------------
              SQLiteStatement attrStatement = null;
              try {
                request = "select s2.db_id, s2.name, s2.value, s2.value_type " +
                          "from com_edge_attribute s1, attribute s2 " +
                          "where s1.db_id_edge = " + Integer.valueOf(db_id_edge).toString() + " and s1.db_id_attribute = s2.db_id;";
                attrStatement = connection.prepare(request,false);
                while(attrStatement.step()) {
                  int db_id_attr = attrStatement.columnInt(0);
                  String db_name = attrStatement.columnString(1);
                  String db_value = attrStatement.columnString(2);
                  String db_type = attrStatement.columnString(3);
                  e.addStorableAttribute(new StorableAttribute(db_id_attr, db_name, db_value,db_type));
                }
              } catch (SQLiteException ex) {
                VisualGraph.log.printException(ex);
              } finally {
                if(attrStatement != null) {
View Full Code Here

            int db_id_edge = currStatement.columnInt(0);
            String id_edge = currStatement.columnString(1);
            int db_source = currStatement.columnInt(2);
            int db_target = currStatement.columnInt(3);
            if(vertexId.contains(db_source) && vertexId.contains(db_target)) {
              StorableEdge e = new StorableEdge(db_id_edge, mapVertexes.get(db_source), mapVertexes.get(db_target), id_edge);
              edges.add(e);
              //add edge attributes
              request.setLength(0);
              request.append("select s1.db_id, s1.name, s1.value, s1.value_type from attribute s1, com_edge_attribute s2 where s1.db_id = s2.db_id_attribute and s2.db_id_edge = ");
              request.append(db_id_edge);
              request.append(";");
             
              SQLiteStatement resultAttribute = connection.prepare(request.toString(), false);
              while (resultAttribute.step()) {
                int db_id_attr = resultAttribute.columnInt(0);
                String name_attr = resultAttribute.columnString(1);
                String value_attr = resultAttribute.columnString(2);
                String type_attr = resultAttribute.columnString(3);
                StorableAttribute attr = new StorableAttribute(db_id_attr, name_attr, value_attr,
                    type_attr);
                e.addStorableAttribute(attr);
              }
            }
          }
          StorableSubGraph ssg = new StorableSubGraph(db_id_sg, id_sg, name_sg, vertexes, edges, direct_sg);
          return(ssg);
View Full Code Here

            if(bufVertex.getStorableId() == db_id_target) {
              target = bufVertex;
            }
          }
          if(source != null && target != null) {
            StorableEdge e = new StorableEdge(db_id_edge, source, target, id_edge);
            listEdge.add(e);
            //attributes-----------------
            Statement attrStatement = null;
            try {
              attrStatement = this.currConnection.createStatement();
              request = "select s2.db_id, s2.name, s2.value " +
                        "from com_edge_attribute s1, attribute s2 " +
                        "where s1.db_id_edge = " + (new Integer(db_id_edge)).toString() + " and s2.db_id = s1.db_id_attribute;";
              ResultSet resultAttribute = attrStatement.executeQuery(request);
              while(resultAttribute.next()) {
                int db_id_attr = resultAttribute.getInt(1);
                String db_name = resultAttribute.getString(2);
                String db_value = resultAttribute.getString(3);
                e.addStorableAttribute(new StorableAttribute(db_id_attr, db_name, db_value));
              }
            } catch (SQLException ex) {
              VisualGraph.log.printException(ex);
            } finally {
              if(attrStatement != null) {
View Full Code Here

                     String trg = e.nestedEdge.get(j).right;
                     if (!e.m_nodeMap.containsKey(trg)) {
                       VisualGraph.log.printInfo("Skip edge between different nested graphs");
                         continue;
                     }
                     StorableEdge ed = new StorableEdge(e.m_nodeMap.get(src), e.m_nodeMap.get(trg),e.nestedEdge.get(j).id);
                     for (Attr a:e.nestedEdge.get(j).properties) {
                       ed.addStorableAttribute(new StorableAttribute(a.name,(String) a.value,  a.type.toString()));
                     }
                     edges.add(ed);
                }
              if (e.name == "")
                e.name = e.id;
View Full Code Here

        }
       
        if (s == null || t == null) {
          //TODO oups
        }
      return new StorableEdge(s,t,"e" + (counter++));
    }
View Full Code Here

                if(bufVertex.getStorableId() == db_id_target) {
                  target = bufVertex;
                }
              }
              if(source != null && target != null) {
                StorableEdge e = new StorableEdge(db_id_edge, source, target, id_edge);
                listEdge.add(e);
                //attributes-----------------
                Statement attrStatement = null;
                try {
                  attrStatement = this.currConnection.createStatement();
                  request = "select s2.db_id, s2.name, s2.value " +
                            "from com_edge_attribute s1, attribute s2 " +
                            "where s1.db_id_edge = " + (new Integer(db_id_edge)).toString() + " and s2.db_id = s1.db_id_attribute;";
                  ResultSet resultAttribute = attrStatement.executeQuery(request);
                  while(resultAttribute.next()) {
                    int db_id_attr = resultAttribute.getInt(1);
                    String db_name = resultAttribute.getString(2);
                    String db_value = resultAttribute.getString(3);
                    e.addStorableAttribute(new StorableAttribute(db_id_attr, db_name, db_value));
                  }
                } catch (SQLException ex) {
                  VisualGraph.log.printException(ex);
                } finally {
                  if(attrStatement != null) {
View Full Code Here

TOP

Related Classes of vg.core.storableGraph.StorableEdge

Copyright © 2018 www.massapicom. 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.