/**
  * Create a SortedVIntList from an array of integers.
  * @param  sortedInts  An array of sorted non negative integers.
  * @param  inputSize   The number of integers to be used from the array.
  */
 public SortedVIntList(int[] sortedInts, int inputSize)
 {
     SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
     for (int i = 0; i < inputSize; i++)
     {
         builder.AddInt(sortedInts[i]);
     }
     builder.Done();
 }
        /// <summary> Create a SortedVIntList from an array of integers.</summary>
        /// <param name="sortedInts"> An array of sorted non negative integers.
        /// </param>
        /// <param name="inputSize">  The number of integers to be used from the array.
        /// </param>
        public SortedVIntList(int[] sortedInts, int inputSize)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);

            for (int i = 0; i < inputSize; i++)
            {
                builder.AddInt(sortedInts[i]);
            }
            builder.Done();
        }
        /**
         * Create a SortedVIntList.
         * @param  docIdSetIterator  An iterator providing document numbers as a set of integers.
         *                  This DocIdSetIterator is iterated completely when this constructor
         *                  is called and it must provide the integers in non
         *                  decreasing order.
         */
        public SortedVIntList(DocIdSetIterator docIdSetIterator)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);

            while (docIdSetIterator.Next())
            {
                builder.AddInt(docIdSetIterator.Doc());
            }
            builder.Done();
        }
        /// <summary> Create a SortedVIntList.</summary>
        /// <param name="docIdSetIterator"> An iterator providing document numbers as a set of integers.
        /// This DocIdSetIterator is iterated completely when this constructor
        /// is called and it must provide the integers in non
        /// decreasing order.
        /// </param>
        public SortedVIntList(DocIdSetIterator docIdSetIterator)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
            int doc;

            while ((doc = docIdSetIterator.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
            {
                builder.AddInt(doc);
            }
            builder.Done();
        }
        /// <summary> Create a SortedVIntList from an OpenBitSet.</summary>
        /// <param name="bits"> A bit set representing a set of integers.
        /// </param>
        public SortedVIntList(OpenBitSet bits)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
            int nextInt = bits.NextSetBit(0);

            while (nextInt != -1)
            {
                builder.AddInt(nextInt);
                nextInt = bits.NextSetBit(nextInt + 1);
            }
            builder.Done();
        }
        /// <summary> Create a SortedVIntList from a BitSet.</summary>
        /// <param name="bits"> A bit set representing a set of integers.
        /// </param>
        public SortedVIntList(System.Collections.BitArray bits)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
            int nextInt = SupportClass.BitSetSupport.NextSetBit(bits, 0);

            while (nextInt != -1)
            {
                builder.AddInt(nextInt);
                nextInt = SupportClass.BitSetSupport.NextSetBit(bits, nextInt + 1);
            }
            builder.Done();
        }
        /**
         * Create a SortedVIntList from a BitSet.
         * @param  bits  A bit set representing a set of integers.
         */
        public SortedVIntList(SupportClass.CollectionsSupport.BitSet bits)
        {
            SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
            int nextInt = bits.NextSetBit(0);

            while (nextInt != -1)
            {
                builder.AddInt(nextInt);
                nextInt = bits.NextSetBit(nextInt + 1);
            }
            builder.Done();
        }
 /**
  * Create a SortedVIntList from a BitSet.
  * @param  bits  A bit set representing a set of integers.
  */
 public SortedVIntList(SupportClass.CollectionsSupport.BitSet bits)
 {
     SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
     int nextInt = bits.NextSetBit(0);
     while (nextInt != -1)
     {
         builder.AddInt(nextInt);
         nextInt = bits.NextSetBit(nextInt + 1);
     }
     builder.Done();
 }
 /**
  * Create a SortedVIntList.
  * @param  docIdSetIterator  An iterator providing document numbers as a set of integers.
  *                  This DocIdSetIterator is iterated completely when this constructor
  *                  is called and it must provide the integers in non
  *                  decreasing order.
  */
 public SortedVIntList(DocIdSetIterator docIdSetIterator)
 {
     SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
     while (docIdSetIterator.Next())
     {
         builder.AddInt(docIdSetIterator.Doc());
     }
     builder.Done();
 }
 /**
  * Create a SortedVIntList from an OpenBitSet.
  * @param  bits  A bit set representing a set of integers.
  */
 public SortedVIntList(OpenBitSet bits)
 {
     SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
     int nextInt = bits.NextSetBit(0);
     while (nextInt != -1)
     {
         builder.AddInt(nextInt);
         nextInt = bits.NextSetBit(nextInt + 1);
     }
     builder.Done();
 }
		/// <summary> Create a SortedVIntList.</summary>
		/// <param name="docIdSetIterator"> An iterator providing document numbers as a set of integers.
		/// This DocIdSetIterator is iterated completely when this constructor
		/// is called and it must provide the integers in non
		/// decreasing order.
		/// </param>
		public SortedVIntList(DocIdSetIterator docIdSetIterator)
		{
			SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
			int doc;
			while ((doc = docIdSetIterator.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
			{
				builder.AddInt(doc);
			}
			builder.Done();
		}
		/// <summary> Create a SortedVIntList from a BitSet.</summary>
		/// <param name="bits"> A bit set representing a set of integers.
		/// </param>
		public SortedVIntList(System.Collections.BitArray bits)
		{
			SortedVIntListBuilder builder = new SortedVIntListBuilder(this);
			int nextInt = Support.BitSetSupport.NextSetBit(bits, 0);
			while (nextInt != - 1)
			{
				builder.AddInt(nextInt);
				nextInt = Support.BitSetSupport.NextSetBit(bits, nextInt + 1);
			}
			builder.Done();
		}