@Test public void reset() throws IOException { ElementType type = new ElementType( "foo", new Property("bar", DataType.USHORT)); Element element0 = new Element(type); element0.setInt("bar", 12); Element element1 = new Element(type); element1.setInt("bar", 12); ElementReader reader = mock(ElementReader.class); when(reader.getElementType()).thenReturn(type); when(reader.readElement()). thenReturn(element0). thenReturn(element1). thenReturn(null); BufferedElementReader target = new BufferedElementReader(reader); assertEquals(element0, target.readElement()); assertEquals(element1, target.readElement()); assertNull(target.readElement()); target.reset(); assertEquals(element0, target.readElement()); assertEquals(element1, target.readElement()); assertNull(target.readElement()); }
public void reset() { nextElement = 0; }
BufferedElementReader implements RandomElementReader { public void reset() { nextElement = 0; } }
BufferedElementReader implements RandomElementReader { public void reset() { nextElement = 0; } BufferedElementReader(final ElementReader reader); }
BufferedElementReader implements RandomElementReader { public void reset() { nextElement = 0; } BufferedElementReader(final ElementReader reader); @Override ElementType getElementType(); @Override int getCount(); @Override Element readElement(final int index); @Override Element readElement(); void reset(); @Override RandomElementReader duplicate(); void detach(); @Override void close(); @Override boolean isClosed(); }
BufferedElementReader implements RandomElementReader { public void reset() { nextElement = 0; } BufferedElementReader(final ElementReader reader); @Override ElementType getElementType(); @Override int getCount(); @Override Element readElement(final int index); @Override Element readElement(); void reset(); @Override RandomElementReader duplicate(); void detach(); @Override void close(); @Override boolean isClosed();  }