@Override public PathInfo getPathInfo(String colKey) { PathInfo pathInfo = null; Value val; try { val = this.record.get(colKey); } catch (NoSuchRecordException e) { throw new RuntimeException("no result column: " + colKey); } String typName = val.type().name(); if ("PATH".equals(typName)) { Path p = val.asPath(); long startId = p.start().id(); long endId = p.end().id(); List<Long> relIds = new ArrayList<Long>(); Iterator<Relationship> it = p.relationships().iterator(); while(it.hasNext()) { Relationship rel = it.next(); relIds.add(Long.valueOf(rel.id())); } pathInfo = new PathInfo(startId, endId, relIds, p); } return pathInfo; }
@Override public PathInfo getPathInfo(String colKey) { PathInfo pathInfo = null; Value val; try { val = this.record.get(colKey); } catch (NoSuchRecordException e) { throw new RuntimeException("no result column: " + colKey); } String typName = val.type().name(); if ("PATH".equals(typName)) { Path p = val.asPath(); long startId = p.start().id(); long endId = p.end().id(); List<Long> relIds = new ArrayList<Long>(); Iterator<Relationship> it = p.relationships().iterator(); while(it.hasNext()) { Relationship rel = it.next(); relIds.add(Long.valueOf(rel.id())); } pathInfo = new PathInfo(startId, endId, relIds, p); } return pathInfo; }