org.eclipse.osgi.service.resolver
Class VersionRange

java.lang.Object
  extended by org.eclipse.osgi.service.resolver.VersionRange

public class VersionRange
extends java.lang.Object

This class represents a version range.

Since:
3.1

Field Summary
static VersionRange emptyRange
          An empty version
 
Constructor Summary
VersionRange(java.lang.String versionRange)
          Constructs a VersionRange from the given versionRange String.
VersionRange(Version minVersion, boolean includeMin, Version maxVersion, boolean includeMax)
          Constructs a VersionRange with the specified minVersion and maxVersion.
 
Method Summary
 boolean equals(java.lang.Object object)
           
 boolean getIncludeMaximum()
          Indicates if the maximum version is included in the version range.
 boolean getIncludeMinimum()
          Indicates if the minimum version is included in the version range.
 Version getMaximum()
          Returns the maximum Version of this VersionRange
 Version getMinimum()
          Returns the minimum Version of this VersionRange
 boolean isIncluded(Version version)
          Returns whether the given version is included in this VersionRange.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

emptyRange

public static final VersionRange emptyRange
An empty version

Constructor Detail

VersionRange

public VersionRange(Version minVersion,
                    boolean includeMin,
                    Version maxVersion,
                    boolean includeMax)
Constructs a VersionRange with the specified minVersion and maxVersion.

Parameters:
minVersion - the minimum version of the range
maxVersion - the maximum version of the range

VersionRange

public VersionRange(java.lang.String versionRange)
Constructs a VersionRange from the given versionRange String.

Parameters:
versionRange - a version range String that specifies a range of versions.
Method Detail

getMinimum

public Version getMinimum()
Returns the minimum Version of this VersionRange

Returns:
the minimum Version of this VersionRange

getIncludeMinimum

public boolean getIncludeMinimum()
Indicates if the minimum version is included in the version range.

Returns:
true if the minimum version is included in the version range; otherwise false is returned

getMaximum

public Version getMaximum()
Returns the maximum Version of this VersionRange

Returns:
the maximum Version of this VersionRange

getIncludeMaximum

public boolean getIncludeMaximum()
Indicates if the maximum version is included in the version range.

Returns:
true if the maximum version is included in the version range; otherwise false is returned

isIncluded

public boolean isIncluded(Version version)
Returns whether the given version is included in this VersionRange. This will depend on the minimum and maximum versions of this VersionRange and the given version.

Parameters:
version - a version to be tested for inclusion in this VersionRange. (may be null)
Returns:
true if the version is include, false otherwise

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object