Пример #1
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");
		}
Пример #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");
        }
Пример #3
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);
		}
Пример #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);
        }
Пример #5
0
 private void  InitBlock(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
Пример #6
0
 public AnonymousClassDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
Пример #7
0
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     InitBlock(enclosingInstance);
     Enclosing_Instance.InitBytes();
     lastInt = 0;
 }
Пример #8
0
 internal AnonymousDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
Пример #9
0
 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);
 }
Пример #12
0
			private void  InitBlock(SortedVIntList enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
Пример #13
0
			public AnonymousClassDocIdSetIterator(SortedVIntList enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
Пример #14
0
			internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
			{
				InitBlock(enclosingInstance);
				Enclosing_Instance.InitBytes();
				lastInt = 0;
			}
Пример #15
0
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     enclosingInstance.InitBytes();
     lastInt = 0;
 }
Пример #16
0
 internal AnonymousDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }