示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void testPagingIterator()
        internal virtual void TestPagingIterator()
        {
            IEnumerator <int>    source = new RangeIterator(24);
            PagingIterator <int> pager  = new PagingIterator <int>(source, 10);

            assertEquals(0, pager.Page());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(pager.HasNext());
            AssertPage(pager.NextPage(), 10, 0);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(pager.HasNext());

            assertEquals(1, pager.Page());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(pager.HasNext());
            AssertPage(pager.NextPage(), 10, 10);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(pager.HasNext());

            assertEquals(2, pager.Page());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(pager.HasNext());
            AssertPage(pager.NextPage(), 4, 20);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertFalse(pager.HasNext());

            pager.Page(1);
            assertEquals(1, pager.Page());
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(pager.HasNext());
            AssertPage(pager.NextPage(), 10, 10);
//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
            assertTrue(pager.HasNext());
        }
示例#2
0
 public PrefetchingIteratorAnonymousInnerClass(PagingIterator <T> outerInstance)
 {
     this.outerInstance = outerInstance;
     end = outerInstance.Position() + outerInstance.pageSize;
 }