net.sf.ant4eclipse.model.pdesupport
Class Version

java.lang.Object
  extended by net.sf.ant4eclipse.model.pdesupport.Version

public class Version
extends java.lang.Object

Encapsulates the version of an eclipse plugin. The version is build from a string with the following syntax: major.minor.micro.qualifier (as specified in the OSGi Service Platform Core Specification, Release 4).


Constructor Summary
Version()
           Creates a new instance of type Version.
Version(java.lang.String version)
           Creates a new instance of type Version.
Version(Version version)
           Creates a new instance of type Version.
 
Method Summary
 void decrementMajor()
           Decrements the major field.
 void decrementMicro()
           Decrements the micro field.
 void decrementMinor()
           Decrements the minor field.
 boolean equals(java.lang.Object o)
          
 long getMajor()
          getting the major field
 long getMicro()
          getting the release field
 long getMinor()
          getting the minor field
 java.lang.String getQualifier()
          getting the build field
 boolean greaterThan(Version dest)
          is this version geater than the destination version?
 int hashCode()
          
 void incrementMajor()
           Increments the major field.
 void incrementMicro()
           Increments the micro field.
 void incrementMinor()
           Increments the minor field.
 boolean lesserThan(Version dest)
          is this version lesser than the destination version?
 void setMajor(int major)
           Sets the major field.
 void setMicro(int micro)
           
 void setMinor(int minor)
           
 void setQualifier(java.lang.String qualifier)
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Version

public Version()

Creates a new instance of type Version.


Version

public Version(java.lang.String version)

Creates a new instance of type Version.

Parameters:
version - the version as a string representation.

Version

public Version(Version version)

Creates a new instance of type Version. All attributes are copied from the given version.

Parameters:
version - the version to copy.
Method Detail

incrementMajor

public final void incrementMajor()

Increments the major field.


incrementMinor

public final void incrementMinor()

Increments the minor field.


incrementMicro

public final void incrementMicro()

Increments the micro field.


decrementMajor

public final void decrementMajor()

Decrements the major field.


decrementMinor

public final void decrementMinor()

Decrements the minor field.


decrementMicro

public final void decrementMicro()

Decrements the micro field.


setMajor

public void setMajor(int major)

Sets the major field.

Parameters:
major -

setMinor

public void setMinor(int minor)
Parameters:
minor -

setMicro

public void setMicro(int micro)
Parameters:
micro -

setQualifier

public void setQualifier(java.lang.String qualifier)
Parameters:
qualifier -

greaterThan

public final boolean greaterThan(Version dest)
is this version geater than the destination version?

Parameters:
dest - destination version
Returns:
true if this version is greater than the destination version, else false

lesserThan

public final boolean lesserThan(Version dest)
is this version lesser than the destination version?

Parameters:
dest - destination version
Returns:
true if this version is lesser than the destination version, else false

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public final java.lang.String toString()

Overrides:
toString in class java.lang.Object

getQualifier

public final java.lang.String getQualifier()
getting the build field

Returns:
int

getMajor

public final long getMajor()
getting the major field

Returns:
int

getMinor

public final long getMinor()
getting the minor field

Returns:
int

getMicro

public final long getMicro()
getting the release field

Returns:
int