org.apache.jackrabbit.core.version
Class VersionSet

java.lang.Object
  extended by org.apache.jackrabbit.core.version.VersionSet
All Implemented Interfaces:
VersionSelector

public class VersionSet
extends Object
implements VersionSelector

This Class implements a version selector that is based on a set of verions.


Constructor Summary
VersionSet(Map<NodeId,InternalVersion> versions)
          Creates a ChangeSetVersionSelector that will try to select a version within the given set of versions.
VersionSet(Map<NodeId,InternalVersion> versions, boolean dateFallback)
          Creates a ChangeSetVersionSelector that will try to select a version in the given set.
 
Method Summary
 InternalVersion select(InternalVersionHistory versionHistory)
          Selects a version of the given version history.
 Map<NodeId,InternalVersion> versions()
          Returns the (modifiable) changeset of this selector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VersionSet

public VersionSet(Map<NodeId,InternalVersion> versions)
Creates a ChangeSetVersionSelector that will try to select a version within the given set of versions.

Parameters:
versions - the set of versions

VersionSet

public VersionSet(Map<NodeId,InternalVersion> versions,
                  boolean dateFallback)
Creates a ChangeSetVersionSelector that will try to select a version in the given set. If the version is missing but dateFall

Parameters:
versions - the set of versions
dateFallback - if true date fallback is enabled.
Method Detail

versions

public Map<NodeId,InternalVersion> versions()
Returns the (modifiable) changeset of this selector. the keys of the map are the node ids of the version histories.

Returns:
the change set

select

public InternalVersion select(InternalVersionHistory versionHistory)
                       throws RepositoryException
Selects a version of the given version history. If this VersionSelector is unable to select one, it can return null. Please note, that a version selector is not allowed to return the root version. Selects a version from set having the given version history.

Specified by:
select in interface VersionSelector
Parameters:
versionHistory - version history to select a version from
Returns:
A version or null.
Throws:
RepositoryException - if an error occurs.


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.