/// <summary>NOTE: modifies and returns either "this" or "other"</summary>
 public virtual ContainsPrefixTreeFilter.SmallDocSet Union(ContainsPrefixTreeFilter.SmallDocSet
                                                           other)
 {
     ContainsPrefixTreeFilter.SmallDocSet bigger;
     ContainsPrefixTreeFilter.SmallDocSet smaller;
     if (other.intSet.Size > this.intSet.Size)
     {
         bigger  = other;
         smaller = this;
     }
     else
     {
         bigger  = this;
         smaller = other;
     }
     //modify bigger
     foreach (int v in smaller.intSet.keys)
     {
         if (v == smaller.intSet.emptyVal)
         {
             continue;
         }
         bigger.Set(v);
     }
     return(bigger);
 }
            /// <exception cref="System.IO.IOException"></exception>
            private ContainsPrefixTreeFilter.SmallDocSet CollectDocs(IBits acceptContains)
            {
                ContainsPrefixTreeFilter.SmallDocSet set = null;
                this.docsEnum = this.termsEnum.Docs(acceptContains, this.docsEnum, DocsEnum.FLAG_NONE
                                                    );
                int docid;

                while ((docid = this.docsEnum.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
                {
                    if (set == null)
                    {
                        int size = this.termsEnum.DocFreq;
                        if (size <= 0)
                        {
                            size = 16;
                        }
                        set = new ContainsPrefixTreeFilter.SmallDocSet(size);
                    }
                    set.Set(docid);
                }
                return(set);
            }
 /// <exception cref="System.IO.IOException"></exception>
 private ContainsPrefixTreeFilter.SmallDocSet CollectDocs(IBits acceptContains)
 {
     ContainsPrefixTreeFilter.SmallDocSet set = null;
     this.docsEnum = this.termsEnum.Docs(acceptContains, this.docsEnum, DocsEnum.FLAG_NONE
         );
     int docid;
     while ((docid = this.docsEnum.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)
     {
         if (set == null)
         {
             int size = this.termsEnum.DocFreq;
             if (size <= 0)
             {
                 size = 16;
             }
             set = new ContainsPrefixTreeFilter.SmallDocSet(size);
         }
         set.Set(docid);
     }
     return set;
 }