internal virtual void  TstIterator(SortedVIntList vintList, int[] ints)
		{
			for (int i = 0; i < ints.Length; i++)
			{
				if ((i > 0) && (ints[i - 1] == ints[i]))
				{
					return ; // DocNrSkipper should not skip to same document.
				}
			}
			DocIdSetIterator m = vintList.Iterator();
			for (int i = 0; i < ints.Length; i++)
			{
				Assert.IsTrue(m.NextDoc() != DocIdSetIterator.NO_MORE_DOCS, "No end of Matcher at: " + i);
				Assert.AreEqual(ints[i], m.DocID());
			}
			Assert.IsTrue(m.NextDoc() == DocIdSetIterator.NO_MORE_DOCS, "End of Matcher");
		}
示例#2
0
        internal virtual void  TstIterator(SortedVIntList vintList, int[] ints)
        {
            for (int i = 0; i < ints.Length; i++)
            {
                if ((i > 0) && (ints[i - 1] == ints[i]))
                {
                    return;                      // DocNrSkipper should not skip to same document.
                }
            }
            DocIdSetIterator m = vintList.Iterator();

            for (int i = 0; i < ints.Length; i++)
            {
                Assert.IsTrue(m.NextDoc() != DocIdSetIterator.NO_MORE_DOCS, "No end of Matcher at: " + i);
                Assert.AreEqual(ints[i], m.DocID());
            }
            Assert.IsTrue(m.NextDoc() == DocIdSetIterator.NO_MORE_DOCS, "End of Matcher");
        }
		public virtual void  TstViaBitSet(int[] ints, int expectedByteSize)
		{
			int MAX_INT_FOR_BITSET = 1024 * 1024;
			//mgarski - BitArray cannot grow, so make as large as we would need it to be
			System.Collections.BitArray bs = new System.Collections.BitArray(MAX_INT_FOR_BITSET);
			for (int i = 0; i < ints.Length; i++)
			{
				if (ints[i] > MAX_INT_FOR_BITSET)
				{
					return ; // BitSet takes too much memory
				}
				if ((i > 0) && (ints[i - 1] == ints[i]))
				{
					return ; // BitSet cannot store duplicate.
				}
				bs.Set(ints[i], true);
			}
			SortedVIntList svil = new SortedVIntList(bs);
			TstVIntList(svil, ints, expectedByteSize);
			TstVIntList(new SortedVIntList(svil.Iterator()), ints, expectedByteSize);
		}
示例#4
0
        public virtual void  TstViaBitSet(int[] ints, int expectedByteSize)
        {
            int MAX_INT_FOR_BITSET = 1024 * 1024;

            //mgarski - BitArray cannot grow, so make as large as we would need it to be
            System.Collections.BitArray bs = new System.Collections.BitArray(MAX_INT_FOR_BITSET);
            for (int i = 0; i < ints.Length; i++)
            {
                if (ints[i] > MAX_INT_FOR_BITSET)
                {
                    return;                      // BitSet takes too much memory
                }
                if ((i > 0) && (ints[i - 1] == ints[i]))
                {
                    return;                      // BitSet cannot store duplicate.
                }
                bs.Set(ints[i], true);
            }
            SortedVIntList svil = new SortedVIntList(bs);

            TstVIntList(svil, ints, expectedByteSize);
            TstVIntList(new SortedVIntList(svil.Iterator()), ints, expectedByteSize);
        }
 private void  InitBlock(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
 public AnonymousClassDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     InitBlock(enclosingInstance);
     Enclosing_Instance.InitBytes();
     lastInt = 0;
 }
 internal AnonymousDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     enclosingInstance.InitBytes();
     lastInt = 0;
 }
示例#10
0
		internal virtual void  TstVIntList(SortedVIntList vintList, int[] ints, int expectedByteSize)
		{
			Assert.AreEqual(ints.Length, vintList.Size, "Size");
			Assert.AreEqual(expectedByteSize, vintList.ByteSize, "Byte size");
			TstIterator(vintList, ints);
		}
示例#11
0
 internal virtual void  TstVIntList(SortedVIntList vintList, int[] ints, int expectedByteSize)
 {
     Assert.AreEqual(ints.Length, vintList.Size, "Size");
     Assert.AreEqual(expectedByteSize, vintList.ByteSize, "Byte size");
     TstIterator(vintList, ints);
 }
			private void  InitBlock(SortedVIntList enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
			public AnonymousClassDocIdSetIterator(SortedVIntList enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
			internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
			{
				InitBlock(enclosingInstance);
				Enclosing_Instance.InitBytes();
				lastInt = 0;
			}
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     enclosingInstance.InitBytes();
     lastInt = 0;
 }
 internal AnonymousDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }