net.sourceforge.argval.version
Class VersionHierarchyImpl

java.lang.Object
  extended by net.sourceforge.argval.version.VersionHierarchyImpl
All Implemented Interfaces:
VersionHierarchy, VersionNumberVisitorAcceptor

public class VersionHierarchyImpl
extends Object
implements VersionHierarchy

Author:
T. Verhagen

Field Summary
protected  org.slf4j.Logger logger
           
 
Fields inherited from interface net.sourceforge.argval.version.VersionHierarchy
VERSION_PART_SEPARATOR
 
Constructor Summary
VersionHierarchyImpl()
           
VersionHierarchyImpl(String versionPartSeparator)
           
 
Method Summary
 void accept(VersionNumberVisitor visitor)
          The entry point for the visitor.
 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.
 String getVersionPartSeparator()
           
 boolean isCompatible(List<String> version)
          Returns true if the version is compatible with the known versions.
 boolean isCompatible(String versionStr)
          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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected org.slf4j.Logger logger
Constructor Detail

VersionHierarchyImpl

public VersionHierarchyImpl()

VersionHierarchyImpl

public VersionHierarchyImpl(String versionPartSeparator)
Method Detail

getVersionPartSeparator

public String getVersionPartSeparator()

addVersion

public void addVersion(VersionNumber version)
Description copied from interface: VersionHierarchy
Adding a version number.

Specified by:
addVersion in interface VersionHierarchy
Parameters:
version - - the version number

addVersion

public void addVersion(String versionStr)
Description copied from interface: VersionHierarchy
Adding a version number. Uses the #convertVersion(String, String) for conversion.

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

addVersion

public void addVersion(List<String> version)
Description copied from interface: VersionHierarchy
Adding a version number.

Specified by:
addVersion in interface VersionHierarchy
Parameters:
version - - as a list containing the version number parts

convertVersion

public List<String> convertVersion(String versionStr)
Specified by:
convertVersion in interface VersionHierarchy
Returns:

isCompatible

public boolean isCompatible(VersionNumber version)
Description copied from interface: VersionHierarchy
Returns true if the version is compatible with the known versions.

Specified by:
isCompatible in interface VersionHierarchy
Parameters:
version - - the version number
Returns:
true if the version is compatible with the known versions , otherwise false.

isCompatible

public boolean isCompatible(String versionStr)
Description copied from interface: VersionHierarchy
Returns true if the version is compatible with the known versions. Uses the #convertVersion(String, String) for conversion.

Specified by:
isCompatible in interface VersionHierarchy
Parameters:
versionStr - - the version number
Returns:
true if the version is compatible with the known versions , otherwise false.

isCompatible

public boolean isCompatible(List<String> version)
Description copied from interface: VersionHierarchy
Returns true if the version is compatible with the known versions.

Specified by:
isCompatible in interface VersionHierarchy
Parameters:
version - - the version number
Returns:
true if the version is compatible with the known versions , otherwise false.

toString

public String toString()
Overrides:
toString in class Object

getRegisteredVersionAsStings

public List<String> getRegisteredVersionAsStings()
Description copied from interface: VersionHierarchy
Returns the registered versions as a List of String instances.

Specified by:
getRegisteredVersionAsStings in interface VersionHierarchy
Returns:
The registered versions as a List of String instances.

getRegisteredVersionNumbers

public List<VersionNumber> getRegisteredVersionNumbers()
Description copied from interface: VersionHierarchy
Returns the registered versions as a List of VersionNumber instances.

Specified by:
getRegisteredVersionNumbers in interface VersionHierarchy
Returns:
The registered versions as a List of VersionNumber instances.

accept

public void accept(VersionNumberVisitor visitor)
Description copied from interface: VersionNumberVisitorAcceptor
The entry point for the visitor.

Specified by:
accept in interface VersionNumberVisitorAcceptor
Parameters:
visitor - - the version number visitor


Copyright © 2013 Verhagen Software. All Rights Reserved.