本文整理汇总了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());
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
示例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());
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
示例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());
}
示例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());
}
示例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;
}
示例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;
}
示例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());
}
示例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();
}