public class VersionHistoryImpl extends java.lang.Object implements VersionHistory
| Modifier and Type | Class and Description |
|---|---|
static class |
VersionHistoryImpl.VersionComparatorAsc
Version Comparator
Note: Ascending (last modified) date order
|
static class |
VersionHistoryImpl.VersionComparatorDesc
Version Comparator
Note: Descending (last modified) date order
|
| Constructor and Description |
|---|
VersionHistoryImpl(Version rootVersion)
Constructor, ensures the root version is set.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addVersion(Version version,
Version predecessor)
Add a version to the version history.
|
java.util.Collection |
getAllVersions()
Gets a collection containing all the versions within the
version history.
|
Version |
getHeadVersion()
Gets the head (current / most recent) version of the version history.
|
Version |
getPredecessor(Version version)
Gets the predecessor of a specified version
|
Version |
getRootVersion()
Gets the root (initial / least recent) version of the version history.
|
java.util.Collection |
getSuccessors(Version version)
Gets the succeeding versions of a specified version.
|
Version |
getVersion(java.lang.String versionLabel)
Gets a version with a specified version label.
|
public VersionHistoryImpl(Version rootVersion)
rootVersion - the root version, can not be null.public Version getRootVersion()
getRootVersion in interface VersionHistorypublic Version getHeadVersion()
getHeadVersion in interface VersionHistorypublic java.util.Collection getAllVersions()
Versions are returned in descending create date order (most recent first).
getAllVersions in interface VersionHistorypublic Version getPredecessor(Version version)
getPredecessor in interface VersionHistoryversion - the version objectpublic java.util.Collection getSuccessors(Version version)
getSuccessors in interface VersionHistoryversion - the version objectpublic Version getVersion(java.lang.String versionLabel)
getVersion in interface VersionHistoryversionLabel - the version labelVersionDoesNotExistException - indicates requested version does not exisitCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.