private <E> Collection<E> parseIntoCollection(Container c, Collection<E> l, ClassMeta<?> type, BeanPropertyMeta pMeta) throws Exception { int argIndex = 0; for (NodeIterator ni = c.iterator(); ni.hasNext();) { E e = (E)parseAnything(type.isArgs() ? type.getArg(argIndex++) : type.getElementType(), ni.next(), l, pMeta); l.add(e); } return l; }
protected void seeWhatsThere( final Container cont2, final boolean[] found ) { final NodeIterator nit = cont2.iterator(); while (nit.hasNext()) { final int v = ((Literal) nit.nextNode()).getInt(); Assert.assertFalse(found[v]); found[v] = true; } }
protected void seeWhatsThere( final Container cont2, final boolean[] found ) { final NodeIterator nit = cont2.iterator(); while (nit.hasNext()) { final int v = ((Literal) nit.nextNode()).getInt(); Assert.assertFalse(found[v]); found[v] = true; } }
protected void retainOnlySpecified( final Container cont2, final int num, final boolean[] retain ) { final NodeIterator nit = cont2.iterator(); for (int i = 0; i < num; i++) { nit.nextNode(); if (retain[i] == false) { nit.remove(); } } Assert.assertFalse(nit.hasNext()); }
protected void retainOnlySpecified( final Container cont2, final int num, final boolean[] retain ) { final NodeIterator nit = cont2.iterator(); for (int i = 0; i < num; i++) { nit.nextNode(); if (retain[i] == false) { nit.remove(); } } Assert.assertFalse(nit.hasNext()); }
protected void checkNumericContent( final Container cont2, final int num ) { final NodeIterator nit = cont2.iterator(); for (int i = 0; i < num; i += 1) { Assert.assertEquals(i, ((Literal) nit.nextNode()).getInt()); } Assert.assertFalse(nit.hasNext()); }
protected void checkNumericContent( final Container cont2, final int num ) { final NodeIterator nit = cont2.iterator(); for (int i = 0; i < num; i += 1) { Assert.assertEquals(i, ((Literal) nit.nextNode()).getInt()); } Assert.assertFalse(nit.hasNext()); }
protected void testContainerOfIntegersWithRemoving( final boolean[] retain ) { final int num = retain.length; final boolean[] found = new boolean[num]; final Container c = createContainer(); for (int i = 0; i < num; i += 1) { c.add(i); } final NodeIterator it = c.iterator(); for ( boolean aRetain : retain ) { it.nextNode(); if ( aRetain == false ) { it.remove(); } } final NodeIterator s = c.iterator(); while (s.hasNext()) { final int v = ((Literal) s.nextNode()).getInt(); Assert.assertFalse(found[v]); found[v] = true; } for (int i = 0; i < num; i += 1) { Assert.assertEquals("element " + i, retain[i], found[i]); } }
protected void testContainerOfIntegersWithRemoving( final boolean[] retain ) { final int num = retain.length; final boolean[] found = new boolean[num]; final Container c = createContainer(); for (int i = 0; i < num; i += 1) { c.add(i); } final NodeIterator it = c.iterator(); for ( boolean aRetain : retain ) { it.nextNode(); if ( aRetain == false ) { it.remove(); } } final NodeIterator s = c.iterator(); while (s.hasNext()) { final int v = ((Literal) s.nextNode()).getInt(); Assert.assertFalse(found[v]); found[v] = true; } for (int i = 0; i < num; i += 1) { Assert.assertEquals("element " + i, retain[i], found[i]); } }
public void testContainerOfIntegers() { final int num = 10; final Container c = createContainer(); for (int i = 0; i < num; i += 1) { c.add(i); } Assert.assertEquals(num, c.size()); final NodeIterator it = c.iterator(); for (int i = 0; i < num; i += 1) { Assert.assertEquals(i, ((Literal) it.nextNode()).getInt()); } Assert.assertFalse(it.hasNext()); }
public void testContainerOfIntegers() { final int num = 10; final Container c = createContainer(); for (int i = 0; i < num; i += 1) { c.add(i); } Assert.assertEquals(num, c.size()); final NodeIterator it = c.iterator(); for (int i = 0; i < num; i += 1) { Assert.assertEquals(i, ((Literal) it.nextNode()).getInt()); } Assert.assertFalse(it.hasNext()); }