Example #1
0
 @Override
 protected QueryIterator processMethod() throws AsyncException {
   // Find index of member.
   int i = GraphList.index(getHandler("i"), new GNode(graph, listNode), member);
   if (i < 0) return IterLib.noResults(execCxt);
   Node idx = NodeFactory.intToNode(i);
   return IterLib.oneResult(binding, var, idx, execCxt);
 }
Example #2
0
 @Override
 protected QueryIterator processMethod() throws AsyncException {
   // Iterate over list
   List<Node> members = GraphList.members(getHandler("members"), new GNode(graph, listNode));
   List<Binding> bindings = new ArrayList<Binding>();
   for (int i = 0; i < members.size(); i++) {
     Node idx = NodeFactory.intToNode(i);
     Node member = members.get(i);
     BindingMap b = BindingFactory.create(binding);
     b.add(varIndex, idx);
     b.add(varMember, member);
     bindings.add(b);
   }
   return new QueryIterPlainWrapper(bindings.iterator(), execCxt);
 }