net.sourceforge.argval.version
Interface VersionHierarchy

All Superinterfaces:
VersionNumberVisitorAcceptor
All Known Implementing Classes:
VersionHierarchyImpl

public interface VersionHierarchy
extends VersionNumberVisitorAcceptor

A version hierarchy can be used to register versions and then check for compatibility.

Author:
T. Verhagen

Field Summary
static String VERSION_PART_SEPARATOR
          The default version part separator '.'.
 
Method Summary
 void addVersion(List<String> version)
          Adding a version number.
 void addVersion(String versionStr)
          Adding a version number.
 void addVersion(VersionNumber version)
          Adding a version number.
 List<String> convertVersion(String versionStr)
           
 List<String> getRegisteredVersionAsStings()
          Returns the registered versions as a List of String instances.
 List<VersionNumber> getRegisteredVersionNumbers()
          Returns the registered versions as a List of VersionNumber instances.
 boolean isCompatible(List<String> version)
          Returns true if the version is compatible with the known versions.
 boolean isCompatible(String version)
          Returns true if the version is compatible with the known versions.
 boolean isCompatible(VersionNumber version)
          Returns true if the version is compatible with the known versions.
 
Methods inherited from interface net.sourceforge.argval.version.VersionNumberVisitorAcceptor
accept
 

Field Detail

VERSION_PART_SEPARATOR

static final String VERSION_PART_SEPARATOR
The default version part separator '.'.

See Also:
Constant Field Values
Method Detail

addVersion

void addVersion(VersionNumber version)
Adding a version number.

Parameters:
version - - the version number

addVersion

void addVersion(String versionStr)
Adding a version number. Uses the #convertVersion(String, String) for conversion.

Parameters:
versionStr - - as a text string separating the version number parts by a separator
See Also:
#convertVersion(String, String)

addVersion

void addVersion(List<String> version)
Adding a version number.

Parameters:
version - - as a list containing the version number parts

convertVersion

List<String> convertVersion(String versionStr)
Parameters:
versionStr -
Returns:

isCompatible

boolean isCompatible(VersionNumber version)
Returns true if the version is compatible with the known versions.

Parameters:
version - - the version number
Returns:
true if the version is compatible with the known versions , otherwise false.

isCompatible

boolean isCompatible(String version)
Returns true if the version is compatible with the known versions. Uses the #convertVersion(String, String) for conversion.

Parameters:
version - - the version number
Returns:
true if the version is compatible with the known versions , otherwise false.

isCompatible

boolean isCompatible(List<String> version)
Returns true if the version is compatible with the known versions.

Parameters:
version - - the version number
Returns:
true if the version is compatible with the known versions , otherwise false.

getRegisteredVersionAsStings

List<String> getRegisteredVersionAsStings()
Returns the registered versions as a List of String instances.

Returns:
The registered versions as a List of String instances.

getRegisteredVersionNumbers

List<VersionNumber> getRegisteredVersionNumbers()
Returns the registered versions as a List of VersionNumber instances.

Returns:
The registered versions as a List of VersionNumber instances.


Copyright © 2013 Verhagen Software. All Rights Reserved.