@Test public void testListIterator() { ByteBuffer src1 = createBuffer("ABC"); cache.add(src1); ByteBuffer src2 = createBuffer("DEF"); cache.add(src2); ByteBuffer src3 = createBuffer("GHI"); cache.add(src3); ListIterator<ByteBuffer> iter = cache.listIterator(); assertTrue(iter.hasNext()); ByteBuffer dest = iter.next(); assertEquals(src1, dest); dest = iter.next(); assertEquals(src2, dest); dest = iter.next(); assertEquals(src3, dest); assertFalse(iter.hasNext()); assertTrue(iter.hasPrevious()); dest = iter.previous(); assertEquals(src3, dest); }
@Override public ListIterator<ByteBuffer> listIterator() { return listIterator(0); }
BufferCache implements List<ByteBuffer> { @Override public ListIterator<ByteBuffer> listIterator() { return listIterator(0); } }
BufferCache implements List<ByteBuffer> { @Override public ListIterator<ByteBuffer> listIterator() { return listIterator(0); } BufferCache();  BufferCache(int cacheCapacity, int bufferCapacity, ByteOrder order); }
BufferCache implements List<ByteBuffer> { @Override public ListIterator<ByteBuffer> listIterator() { return listIterator(0); } BufferCache();  BufferCache(int cacheCapacity, int bufferCapacity, ByteOrder order); @Override boolean add(ByteBuffer src); @Override void add(int index, ByteBuffer src); @Override boolean addAll(Collection<? extends ByteBuffer> c); @Override boolean addAll(int index, Collection<? extends ByteBuffer> c); @Override void clear(); @Override boolean contains(Object o); @Override boolean containsAll(Collection<?> c); @Override ByteBuffer get(int index); @Override int indexOf(Object o); @Override boolean isEmpty(); @Override Iterator<ByteBuffer> iterator(); @Override int lastIndexOf(Object o); @Override ListIterator<ByteBuffer> listIterator(); @Override ListIterator<ByteBuffer> listIterator(int index); @Override ByteBuffer remove(int index); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override ByteBuffer set(int index, ByteBuffer src); @Override int size(); @Override List<ByteBuffer> subList(int fromIndex, int toIndex); @Override Object[] toArray(); @SuppressWarnings("unchecked") T[] toArray(T[] a); }
BufferCache implements List<ByteBuffer> { @Override public ListIterator<ByteBuffer> listIterator() { return listIterator(0); } BufferCache();  BufferCache(int cacheCapacity, int bufferCapacity, ByteOrder order); @Override boolean add(ByteBuffer src); @Override void add(int index, ByteBuffer src); @Override boolean addAll(Collection<? extends ByteBuffer> c); @Override boolean addAll(int index, Collection<? extends ByteBuffer> c); @Override void clear(); @Override boolean contains(Object o); @Override boolean containsAll(Collection<?> c); @Override ByteBuffer get(int index); @Override int indexOf(Object o); @Override boolean isEmpty(); @Override Iterator<ByteBuffer> iterator(); @Override int lastIndexOf(Object o); @Override ListIterator<ByteBuffer> listIterator(); @Override ListIterator<ByteBuffer> listIterator(int index); @Override ByteBuffer remove(int index); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override ByteBuffer set(int index, ByteBuffer src); @Override int size(); @Override List<ByteBuffer> subList(int fromIndex, int toIndex); @Override Object[] toArray(); @SuppressWarnings("unchecked") T[] toArray(T[] a); static final int DEFAULT_BUFFER_CAPACITY; static final int DEFAULT_CACHE_CAPACITY; }