当前位置: 首页>>代码示例>>Java>>正文


Java Result.hasNext方法代码示例

本文整理汇总了Java中org.neo4j.graphdb.Result.hasNext方法的典型用法代码示例。如果您正苦于以下问题:Java Result.hasNext方法的具体用法?Java Result.hasNext怎么用?Java Result.hasNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.neo4j.graphdb.Result的用法示例。


在下文中一共展示了Result.hasNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadTableBD

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadTableBD(int num) {
    Result res = db.execute("MATCH (n:`Avion`{numero:"+num+"}) RETURN n.numero, n.type, n.capacite");
    DefaultTableModel dtm = new DefaultTableModel(0,0);
    String header[] = {"Numero", "Type", "Capacite"};
    String test[] = {"n.numero", "n.type", "n.capacite"};
    dtm.setColumnIdentifiers(header);
    jTable1.setModel(dtm);
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        Map<String, Object> obj = new LinkedHashMap();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
        
        dtm.addRow(obj.values().toArray());
}
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:21,代码来源:AfficherAvions.java

示例2: loadTableBD

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadTableBD() {
    Result res = db.execute("MATCH (a:Avion)-[r:Affecter]->(d:Depart)<-[c:Constituer]-(v:Vol) RETURN d.numero, d.date, v.villeDep, v.villeArr,  a.type, a.capacite, v.numero, v.heureDep, v.heureArr");
    DefaultTableModel dtm = new DefaultTableModel(0,0);
    String header[] = {"Numero", "Date","Depart", "Arriveé", "Type", "Capacite", "NumVol", "Heure De Depart", "Heure d'arrive"};
    String test[] = {"d.numero", "d.date","v.villeDep", "v.villeArr", "a.type", "a.capacite", "v.numero", "v.heureDep", "v.heureArr"};
    dtm.setColumnIdentifiers(header);
    jTable1.setModel(dtm);
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        Map<String, Object> obj = new LinkedHashMap();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
        
        dtm.addRow(obj.values().toArray());
}
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:21,代码来源:AfficherDepart.java

示例3: loadTableBD

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadTableBD() {
    Result res = db.execute("MATCH (n:`Personnel`) RETURN n.cin, n.numPassport, n.nom, n.adresse, n.telephone, n.type");
    DefaultTableModel dtm = new DefaultTableModel(0,0);
    String header[] = {"Cin", "Passeport", "Nom", " Adresse", "Telephone", "Type"};
    String test[] = {"n.cin", "n.numPassport", "n.nom", "n.adresse", "n.telephone", "n.type"};
    dtm.setColumnIdentifiers(header);
    jTable1.setModel(dtm);
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        Map<String, Object> obj = new LinkedHashMap();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
        dtm.addRow(obj.values().toArray());
}
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:20,代码来源:AfficherEmployees.java

示例4: loadDb

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadDb(int pos, String type) {
    post= pos;
    this.type = type;
    Result res = db.execute("MATCH (n:Personnel {cin:"+pos+"}) RETURN n.cin, n.numPassport, n.nom, n.adresse, n.telephone");
    String test[] = {"n.cin", "n.numPassport", "n.nom", "n.adresse", "n.telephone"};
    Map<String, Object> obj = new LinkedHashMap();
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
    }
    res.close();
    cin.setText(obj.get("n.cin").toString());
    passeport.setText(obj.get("n.numPassport").toString());
    nom.setText(obj.get("n.nom").toString());
    tel.setText(obj.get("n.telephone").toString());
    adresse.setText(obj.get("n.adresse").toString());
    
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:24,代码来源:ModifierEmp.java

示例5: loadDb

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadDb(int pos) {
    post= pos;
    Result res = db.execute("MATCH (n:Vol {numero:"+pos+"}) RETURN n.numero, n.villeDep, n.villeArr, n.heureDep, n.heureArr, n.distance, n.frequence");
    String test[] = {"n.numero", "n.villeDep", "n.villeArr", "n.heureDep", "n.heureArr", "n.distance", "n.frequence"};
    Map<String, Object> obj = new LinkedHashMap();
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
    }
    res.close();
    villeDepart.setText(obj.get("n.villeDep").toString());
    villeArrive.setText(obj.get("n.villeArr").toString());
    heureDepart.setText(obj.get("n.heureDep").toString());
    heureArrive.setText(obj.get("n.heureArr").toString());
    distance.setText(obj.get("n.distance").toString());
    frequence.setText(obj.get("n.frequence").toString());
    
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:24,代码来源:ModifierVol.java

示例6: loadTableBD

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadTableBD() {
    Result res = db.execute("MATCH (n:`Passager`) RETURN n.cin, n.numPassport, n.nom, n.adresse, n.telephone");
    DefaultTableModel dtm = new DefaultTableModel(0,0);
    String header[] = {"Cin", "Passeport", "Nom", " Adresse", "Telephone"};
    String test[] = {"n.cin", "n.numPassport", "n.nom", "n.adresse", "n.telephone"};
    dtm.setColumnIdentifiers(header);
    jTable1.setModel(dtm);
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        Map<String, Object> obj = new LinkedHashMap();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
        dtm.addRow(obj.values().toArray());
}
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:20,代码来源:AfficherPassagers.java

示例7: loadTableBD

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadTableBD() {
    Result res = db.execute("MATCH (n:`Vol`) RETURN n.numero, n.villeDep, n.villeArr, n.heureDep, n.heureArr, n.distance, n.frequence ORDER BY n.numero");
    DefaultTableModel dtm = new DefaultTableModel(0,0);
    String header[] = {"n.numero", "Depart", "Arrivee", "Heure Depart", "Heure Arrivee", "Distance", "Frequence"};
    String test[] = {"n.numero", "n.villeDep", "n.villeArr", "n.heureDep", "n.heureArr", "n.distance", "n.frequence"};
    dtm.setColumnIdentifiers(header);
    jTable1.setModel(dtm);
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        Map<String, Object> obj = new LinkedHashMap();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
        
        dtm.addRow(obj.values().toArray());
}
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:21,代码来源:AfficherVols.java

示例8: loadTableBD

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadTableBD(String dateAuj) {
    Result res = db.execute("MATCH (a:Avion)-[r:Affecter]->(d:Depart)<-[c:Constituer]-(v:Vol) WHERE d.date='"+dateAuj+"' RETURN d.numero, d.date, v.villeDep, v.villeArr,  a.type, a.capacite, v.numero, v.heureDep, v.heureArr");
    DefaultTableModel dtm = new DefaultTableModel(0,0);
    String header[] = {"Numero", "Date","Depart", "Arriveé", "Type", "Capacite", "NumVol", "Heure De Depart", "Heure d'arrive"};
    String test[] = {"d.numero", "d.date","v.villeDep", "v.villeArr", "a.type", "a.capacite", "v.numero", "v.heureDep", "v.heureArr"};
    dtm.setColumnIdentifiers(header);
    jTable1.setModel(dtm);
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        Map<String, Object> obj = new LinkedHashMap();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
        
        dtm.addRow(obj.values().toArray());
}
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:21,代码来源:MainWindow.java

示例9: loadDb

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadDb(int pos) {
    post= pos;
    Result res = db.execute("MATCH (n:Passager {cin:"+pos+"}) RETURN n.cin, n.numPassport, n.nom, n.adresse, n.telephone");
    String test[] = {"n.cin", "n.numPassport", "n.nom", "n.adresse", "n.telephone"};
    Map<String, Object> obj = new LinkedHashMap();
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
    }
    res.close();
    cin.setText(obj.get("n.cin").toString());
    passeport.setText(obj.get("n.numPassport").toString());
    nom.setText(obj.get("n.nom").toString());
    tel.setText(obj.get("n.telephone").toString());
    adresse.setText(obj.get("n.adresse").toString());
    
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:23,代码来源:ModifierPass.java

示例10: loadDb

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public void loadDb(int pos) {
    post= pos;
    Result res = db.execute("MATCH (n:Avion {numero:"+pos+"}) RETURN n.numero, n.type, n.capacite");
    String test[] = {"n.numero", "n.type", "n.capacite"};
    Map<String, Object> obj = new LinkedHashMap();
    while(res.hasNext()) {
        Map<String, Object> row = res.next();
        for (String t:test) {
            obj.put(t, null);
        }
        for(Map.Entry<String, Object> col : row.entrySet()) {
             obj.put(col.getKey(),col.getValue());   
        }
    }
    res.close();
    typef.setText(obj.get("n.type").toString());
    capacitef.setText(obj.get("n.capacite").toString());
    
}
 
开发者ID:ATF19,项目名称:flight-management-system-java,代码行数:20,代码来源:ModifierAvion.java

示例11: GraphWalker

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public GraphWalker(DbServiceDecorator dbServices, long rootId, boolean simple, boolean cfg) {
        this.simple = simple;
        this.cfg = cfg;

        final Node root = dbServices.getNodeById(rootId);
        nodes.add(root);

        final Result result = dbServices.execute(
                "MATCH (root)-[*]->(n) WHERE id(root) = $rootId RETURN id(n) as id",
                ImmutableMap.of("rootId", rootId)
            );

        while (result.hasNext()) {
            final Map<String, Object> next = result.next();
            nodes.add(dbServices.getNodeById(Long.valueOf(next.get("id").toString())));
        }

//            nodes = dbServices.graphDb
//                    .traversalDescription()
//                    .breadthFirst()
//                    .traverse(root)
//                    .nodes()
//                    .stream().map(node -> node).collect(Collectors.toList());
    }
 
开发者ID:FTSRG,项目名称:codemodel-rifle,代码行数:25,代码来源:GraphWalker.java

示例12: findNodeIntoGraphDb

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
/**
 * Search into database if exists a node with documentId
 * @param label 
 * @param documentId
 * @return
 */
private Node findNodeIntoGraphDb(Label label, DocumentId documentId) {
	Node node = null;
	
	//check if node already exists
	String query = "MATCH (n:"+label.name()+" {"+documentId.toCypherFilter()+"}) RETURN n";
	if(log.isDebugEnabled())
	{
		log.debug(query);
	}
	
	Result result = db.execute(query);
	while (result.hasNext()) {
		Map<String, Object> row = result.next();
		node = (Node) row.get("n");
		if(log.isDebugEnabled())
		{
			log.debug("Found: "+node);
		}
	}
	return node;
}
 
开发者ID:larusba,项目名称:doc2graph,代码行数:28,代码来源:DocumentGrapherRecursive.java

示例13: getVertexLocalClusteringCoefficient

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
public double getVertexLocalClusteringCoefficient(long index, int partition) {
    double value = 0;

    try {
        beginTransaction();

        Result result = graphDb.execute("MATCH (a:NODE{INDEX:" + index + ", PARTITION:" + partition + "})--(b:NODE{PARTITION:" + partition + "}), (c:NODE{INDEX:" + index + ", PARTITION:" + partition + "})--(d:NODE{PARTITION:" + partition + "}), (c)--(e:NODE{PARTITION:" + partition + "}), (d)-[r]-(e) "
                + "RETURN count(distinct(b)) AS k, count(distinct(r)) AS num");

        if (result.hasNext()) {
            Map<String, Object> row = result.next();
            Long k = (Long) row.get("k");
            Long num = (Long) row.get("num");

            if (k > 1) {
                value = (2 * num.doubleValue()) / (k.doubleValue() * (k.doubleValue() - 1));
            }
        }

    } finally {
        endTransaction();
    }

    return value;

}
 
开发者ID:rafaelmss,项目名称:GraphClustering,代码行数:27,代码来源:NetworkNeo4j.java

示例14: getAllEdgesSortedByWightDesc

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
@Override
public Iterable<Edge> getAllEdgesSortedByWightDesc() {
    List<Edge> list = new ArrayList<>();
    try {
        beginTransaction();
        Result result = graphDb.execute("MATCH (a:NODE)-[r:LINK]->(b:NODE) RETURN r ORDER BY r.WIGHT DESC");
        while (result.hasNext()) {
            Map<String, Object> row = result.next();
            Relationship rel = (Relationship) row.get("r");

            Vertex v1 = getVertex((long) rel.getStartNode().getProperty(NetworkNeo4jProperties.INDEX));
            Vertex v2 = getVertex((long) rel.getEndNode().getProperty(NetworkNeo4jProperties.INDEX));

            Edge edge = new Edge((long) rel.getProperty(NetworkNeo4jProperties.INDEX),
                    (int) rel.getProperty(NetworkNeo4jProperties.WEIGHT),
                    v1,
                    v2);
            list.add(edge);
        }
    } finally {
        endTransaction();
    }
    return new EdgeIterable<Edge>(list.iterator(), new Edge());
}
 
开发者ID:rafaelmss,项目名称:GraphClustering,代码行数:25,代码来源:NetworkNeo4j.java

示例15: getPartitions

import org.neo4j.graphdb.Result; //导入方法依赖的package包/类
@Override
public Iterator<Integer> getPartitions() {
    List<Integer> list = new ArrayList<>();
    try {
        beginTransaction();
        Result result = graphDb.execute("MATCH (n:NODE) RETURN DISTINCT n.PARTITION ORDER BY n.PARTITION");
        while (result.hasNext()) {
            Map<String, Object> row = result.next();
            int partition = (int) row.get("n.PARTITION");
            list.add(partition);
        }
    } finally {
        endTransaction();
    }
    return list.iterator();
}
 
开发者ID:rafaelmss,项目名称:GraphClustering,代码行数:17,代码来源:NetworkNeo4j.java


注:本文中的org.neo4j.graphdb.Result.hasNext方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。