Ejemplo n.º 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");
		}
Ejemplo n.º 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");
        }
Ejemplo n.º 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);
		}
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 private void  InitBlock(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
Ejemplo n.º 6
0
 public AnonymousClassDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     InitBlock(enclosingInstance);
 }
Ejemplo n.º 7
0
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     InitBlock(enclosingInstance);
     Enclosing_Instance.InitBytes();
     lastInt = 0;
 }
Ejemplo n.º 8
0
 internal AnonymousDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }
Ejemplo n.º 9
0
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     enclosingInstance.InitBytes();
     lastInt = 0;
 }
Ejemplo n.º 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);
		}
Ejemplo n.º 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);
 }
Ejemplo n.º 12
0
			private void  InitBlock(SortedVIntList enclosingInstance)
			{
				this.enclosingInstance = enclosingInstance;
			}
Ejemplo n.º 13
0
			public AnonymousClassDocIdSetIterator(SortedVIntList enclosingInstance)
			{
				InitBlock(enclosingInstance);
			}
Ejemplo n.º 14
0
			internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
			{
				InitBlock(enclosingInstance);
				Enclosing_Instance.InitBytes();
				lastInt = 0;
			}
Ejemplo n.º 15
0
 internal SortedVIntListBuilder(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
     enclosingInstance.InitBytes();
     lastInt = 0;
 }
Ejemplo n.º 16
0
 internal AnonymousDocIdSetIterator(SortedVIntList enclosingInstance)
 {
     this.enclosingInstance = enclosingInstance;
 }