Jalopy 1.0b10

de.hunsicker.util
Class Version

java.lang.Object
  |
  +--de.hunsicker.util.Version

public class Version
extends Object

A class that represents version information. Version numbering follows the "Dewey Decimal" syntax that consists of positive decimal integers separated by periods "."

Version:
$Revision: 1.2 $
Author:
Marco Hunsicker

Constructor Summary
Version(String name, int major, int minor)
          Creates a new Version object.
Version(String name, int major, int minor, int micro)
          Creates a new Version object.
Version(String name, int major, int minor, int micro, boolean beta)
          Creates a new Version object.
 
Method Summary
 boolean equals(Object o)
          {@inheritDoc}
 byte getMajorNumber()
          Returns the major version number.
 byte getMicroNumber()
          Returns the micro version number.
 byte getMinorNumber()
          Returns the minor version number.
 String getName()
          Returns the version name.
 int hashCode()
          {@inheritDoc}
 boolean isBeta()
          Indicates whether this version represents a beta state.
 String toString()
          {@inheritDoc}
static Version valueOf(String version)
          Returns the version object for the given string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version(String name,
               int major,
               int minor)
Creates a new Version object.
Parameters:
name - a product version name, may be null
major - the major version number.
minor - the minor version number.

Version

public Version(String name,
               int major,
               int minor,
               int micro)
Creates a new Version object.
Parameters:
name - a product version name, may be null
major - the major version number.
minor - the minor version number.
micro - the micro version number.

Version

public Version(String name,
               int major,
               int minor,
               int micro,
               boolean beta)
Creates a new Version object.
Parameters:
name - a product version name, may be null
major - the major version number.
minor - the minor version number.
micro - the micro version number.
beta - true indicates that this is a beta version.
Method Detail

isBeta

public boolean isBeta()
Indicates whether this version represents a beta state.
Returns:
true if this version represents a beta state.

getMajorNumber

public byte getMajorNumber()
Returns the major version number.
Returns:
major version number

getMicroNumber

public byte getMicroNumber()
Returns the micro version number.
Returns:
micro version number

getMinorNumber

public byte getMinorNumber()
Returns the minor version number.
Returns:
minor version number

getName

public String getName()
Returns the version name.
Returns:
version name. Returns null if no product version name was specified.

equals

public boolean equals(Object o)
{@inheritDoc}
Overrides:
equals in class Object

hashCode

public int hashCode()
{@inheritDoc}
Overrides:
hashCode in class Object

toString

public String toString()
{@inheritDoc}
Overrides:
toString in class Object

valueOf

public static Version valueOf(String version)
Returns the version object for the given string.
Parameters:
version - a string representing version information. The string must consist of multiple (up to three) positive decimal integers separated by periods and may contain the character 'b' instead of the last period (indicating a beta version). E.g. 1.0, 1.4.1, 1.0b5 are valid, 1, 1b5, 1.3.3.1 are not.
Returns:
version version object for the given string.
Throws:
IllegalArgumentException - if version represents no valid version information.

Jalopy 1.0b10

Submit a bug or feature.

For further information and documentation, visit the official Jalopy website.
This page generated: November 14 2002