lapis
Interface Versions

All Known Implementing Classes:
SingleDocVersions

public interface Versions

Versions is a set of document versions from which a region set is derived. Contains at most one version per document (i.e., if v1!=v2 are in the set, then v1.doc != v2.doc). Versions is immutable.


Method Summary
 boolean compatible(Versions vs)
          Test whether two Versions are compatible -- i.e., whether two region sets with those Versions can be safely combined without coordinate conversion.
 boolean contains(Document doc)
           
 boolean contains(DocumentVersion ver)
           
 Iterator documents()
           
 boolean equals(Object obj)
           
 int getSize()
           
 DocumentVersion getVersion(Document doc)
          get doc's version, which is stored in Versions
 Iterator versions()
           
 

Method Detail

versions

public Iterator versions()
Returns:
an iterator over the set of document versions

documents

public Iterator documents()
Returns:
an iterator over the set of documents

getSize

public int getSize()
Returns:
the number of versions (or equivalently, the number of documents) that Versions contains

contains

public boolean contains(DocumentVersion ver)
Parameters:
ver - a document version
Returns:
true if ver is in Versions, false otherwise.

contains

public boolean contains(Document doc)
Parameters:
doc - a document
Returns:
true if doc is in Versions, false otherwise.

getVersion

public DocumentVersion getVersion(Document doc)
get doc's version, which is stored in Versions

Parameters:
doc - a document
Returns:
doc's version, which is stored in Versions, if doc is in Versions. null otherwise.

equals

public boolean equals(Object obj)
Returns:
true if obj is an instance of Versions and obj contains the same set of DocumentVersion as this. false otherwise.

compatible

public boolean compatible(Versions vs)
Test whether two Versions are compatible -- i.e., whether two region sets with those Versions can be safely combined without coordinate conversion.

Parameters:
vs - a Versions
Returns:
true if and only if for every document doc shared by this and vs, this.getVersion(doc) == vs.getVersion(doc).