org.exist.dom
Class DocumentSet

java.lang.Object
  extended by org.exist.util.hashtable.AbstractHashtable
      extended by org.exist.util.hashtable.Int2ObjectHashMap
          extended by org.exist.dom.DocumentSet
All Implemented Interfaces:
NodeList

public class DocumentSet
extends Int2ObjectHashMap
implements 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(Node node)
           
 void addAll(DBBroker broker, Collection collection, String[] paths, boolean checkPermissions)
          Fast method to add a bunch of documents from a Java collection.
 void addAll(DBBroker broker, Collection collection, String[] paths, LockedDocumentMap lockMap, int lockType)
          Fast method to add a bunch of documents from a Java collection.
 void addAll(NodeList other)
           
 void addCollection(Collection collection)
           
 void clear()
           
 boolean contains(DocumentSet other)
           
 boolean contains(int id)
           
 boolean equals(Object other)
           
 int getCollectionCount()
           
 Iterator getCollectionIterator()
           
 DocumentImpl getDoc(int docId)
           
 int getLength()
           
 int getMaxDocId()
           
 int getMinDocId()
           
 XmldbURI[] getNames()
           
 DocumentSet intersection(DocumentSet other)
           
 Node item(int pos)
           
 Iterator iterator()
           
 void lock(DBBroker broker, boolean exclusive, boolean checkExisting)
           
 NodeSet toNodeSet()
           
 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(Node node)

addAll

public void addAll(NodeList other)

addAll

public void addAll(DBBroker broker,
                   Collection collection,
                   String[] paths,
                   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.


addAll

public void addAll(DBBroker broker,
                   Collection collection,
                   String[] paths,
                   LockedDocumentMap lockMap,
                   int lockType)
            throws LockException
Fast method to add a bunch of documents from a Java collection. A lock will be acquired on each document. The locked document is added to the specified LockedDocumentMap in order to keep track of the locks..

Parameters:
broker -
collection -
paths -
lockMap -
lockType -
Throws:
LockException

addCollection

public void addCollection(Collection collection)

iterator

public Iterator iterator()
Overrides:
iterator in class Int2ObjectHashMap

getCollectionIterator

public Iterator getCollectionIterator()

getLength

public int getLength()
Specified by:
getLength in interface NodeList

getCollectionCount

public int getCollectionCount()

item

public Node item(int pos)
Specified by:
item in interface 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(Object other)
Overrides:
equals in class Object

lock

public void lock(DBBroker broker,
                 boolean exclusive,
                 boolean checkExisting)
          throws LockException
Throws:
LockException

unlock

public void unlock(boolean exclusive)

toString

public String toString()
Overrides:
toString in class Object


Copyright (C) Wolfgang Meier. All rights reserved.