## org.exist.dom
Class DocumentSet

    java.lang.Object
      org.exist.util.hashtable.AbstractHashtable
          org.exist.util.hashtable.Int2ObjectHashMap
              org.exist.dom.DocumentSet

All Implemented Interfaces:
  org.w3c.dom.NodeList

public class DocumentSet
extends Int2ObjectHashMap
implements org.w3c.dom.NodeList

Manages a set of documents. This class implements the NodeList interface for a collection of documents. It also contains methods to retrieve the collections these documents belong to.

Author:
  wolf

Field Summary
`static DocumentSet` `EMPTY_DOCUMENT_SET`

Constructor Summary
`DocumentSet()`
`DocumentSet(int initialSize)`

Method Summary
`void` `add(DocumentImpl doc)`
`void` `add(DocumentImpl doc, boolean checkDuplicates)`
`void` `add(org.w3c.dom.Node node)`
`void` `addAll(DBBroker broker, java.util.Collection docs, boolean checkPermissions)` Fast method to add a bunch of documents from a Java collection.
`void` `addAll(org.w3c.dom.NodeList other)`
`void` `addCollection(Collection collection)`
`void` `clear()`
`boolean` `contains(DocumentSet other)`
`boolean` `contains(int id)`
`boolean` `equals(java.lang.Object other)`
`int` `getCollectionCount()`
`java.util.Iterator` `getCollectionIterator()`
`DocumentImpl` `getDoc(int docId)`
`int` `getLength()`
`int` `getMaxDocId()`
`int` `getMinDocId()`
`XmldbURI[]` `getNames()`
`DocumentSet` `intersection(DocumentSet other)`
`org.w3c.dom.Node` `item(int pos)`
`java.util.Iterator` `iterator()`
`void` `lock(boolean exclusive)`
`NodeSet` `toNodeSet()`
`java.lang.String` `toString()`
`DocumentSet` `union(DocumentSet other)`
`void` `unlock(boolean exclusive)`

Methods inherited from class org.exist.util.hashtable.Int2ObjectHashMap
`containsKey, get, put, remove, valueIterator`

Methods inherited from class org.exist.util.hashtable.AbstractHashtable
`getMaxRehash, isPrime, nextPrime, size`

Methods inherited from class java.lang.Object
`getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### EMPTY_DOCUMENT_SET

    public static final DocumentSet EMPTY_DOCUMENT_SET

Constructor Detail

### DocumentSet

    public DocumentSet()

### DocumentSet

    public DocumentSet(int initialSize)

Method Detail

### clear

    public void clear()

  Overrides:
    `clear` in class `Int2ObjectHashMap`

### add

    public void add(DocumentImpl doc)

### add

    public void add(DocumentImpl doc,
                    boolean checkDuplicates)

### add

    public void add(org.w3c.dom.Node node)

### addAll

    public void addAll(org.w3c.dom.NodeList other)

### addAll

    public void addAll(DBBroker broker,
                       java.util.Collection docs,
                       boolean checkPermissions)

  Fast method to add a bunch of documents from a Java collection. The method assumes that no duplicate entries are in the input collection.

  Parameters:
    `docs` -

### addCollection

    public void addCollection(Collection collection)

### iterator

    public java.util.Iterator iterator()

  Overrides:
    `iterator` in class `Int2ObjectHashMap`

### getCollectionIterator

    public java.util.Iterator getCollectionIterator()

### getLength

    public int getLength()

  Specified by:
    `getLength` in interface `org.w3c.dom.NodeList`

### getCollectionCount

    public int getCollectionCount()

### item

    public org.w3c.dom.Node item(int pos)

  Specified by:
    `item` in interface `org.w3c.dom.NodeList`

### getDoc

    public DocumentImpl getDoc(int docId)

### getNames

    public XmldbURI[] getNames()

### intersection

    public DocumentSet intersection(DocumentSet other)

### union

    public DocumentSet union(DocumentSet other)

### contains

    public boolean contains(DocumentSet other)

### contains

    public boolean contains(int id)

### toNodeSet

    public NodeSet toNodeSet()

### getMinDocId

    public int getMinDocId()

### getMaxDocId

    public int getMaxDocId()

### equals

    public boolean equals(java.lang.Object other)

### lock

    public void lock(boolean exclusive)
              throws LockException

  Throws:
    `LockException`

### unlock

    public void unlock(boolean exclusive)

### toString

    public java.lang.String toString()

Copyright (C) Wolfgang Meier. All rights reserved.