private static QueryIterator getByIndex(Graph graph, Binding binding, Node listNode, Node indexNode, Var varMember, ExecutionContext execCxt) { int i = NodeFactoryExtra.nodeToInt(indexNode) ; if ( i < 0 ) return IterLib.noResults(execCxt) ; Node n = GraphList.get(new GNode(graph, listNode), i) ; if ( n == null ) return IterLib.noResults(execCxt) ; return IterLib.oneResult(binding, varMember, n, execCxt) ; }
@Test public void testListGet_3() { assertNull(GraphList.get(list4, -1)) ; }
@Test public void testListGet_4() { assertNull(GraphList.get(list4, 9)) ; }
@Test public void testListGet_1() { assertNull(GraphList.get(emptyList, 0)) ; }
@Test public void testListGet_2() { assertNull(GraphList.get(emptyList, -1)) ; }
@Test public void testListGet_5() { assertEquals(node1, GraphList.get(list4, 0)) ; }
private static QueryIterator testSlotValue(Graph graph, Binding binding, Node listNode, Node indexNode, Node memberNode, ExecutionContext execCxt) { int i = NodeFactoryExtra.nodeToInt(indexNode) ; if ( i < 0 ) return IterLib.noResults(execCxt) ; Node n = GraphList.get(new GNode(graph, listNode), i) ; if ( n == null ) return IterLib.noResults(execCxt) ; if ( n.equals(memberNode) ) return IterLib.result(binding, execCxt) ; else return IterLib.noResults(execCxt) ; }