org.apache.aries.util
Class VersionRange

java.lang.Object
  extended by org.apache.aries.util.VersionRange

public final class VersionRange
extends Object


Constructor Summary
VersionRange(String version)
           
VersionRange(String version, boolean exactVersion)
          This method should be used to create a version range from a single version string.
 
Method Summary
 boolean equals(Object other)
           
 Version getExactVersion()
           
 Version getMaximumVersion()
           
 Version getMinimumVersion()
           
 int hashCode()
           
 VersionRange intersect(VersionRange r)
           
 boolean isExactVersion()
           
 boolean isMaximumExclusive()
           
 boolean isMaximumUnbounded()
           
 boolean isMinimumExclusive()
           
 boolean matches(Version version)
          This method checks that the provided version matches the desired version.
static VersionRange parseVersionRange(String s)
          Parse a version range..
static VersionRange parseVersionRange(String s, boolean exactVersion)
          Parse a version range and indicate if the version is an exact version
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionRange

public VersionRange(String version)
Parameters:
version - version for the verioninfo

VersionRange

public VersionRange(String version,
                    boolean exactVersion)
This method should be used to create a version range from a single version string.

Parameters:
version - version for the versioninfo
exactVersion - whether this is an exact version true or goes to infinity false
Method Detail

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object other)
Overrides:
equals in class Object

getExactVersion

public Version getExactVersion()

getMaximumVersion

public Version getMaximumVersion()

getMinimumVersion

public Version getMinimumVersion()

isMaximumExclusive

public boolean isMaximumExclusive()

isMaximumUnbounded

public boolean isMaximumUnbounded()

isMinimumExclusive

public boolean isMinimumExclusive()

matches

public boolean matches(Version version)
This method checks that the provided version matches the desired version.

Parameters:
version - the version.
Returns:
true if the version matches, false otherwise.

isExactVersion

public boolean isExactVersion()

intersect

public VersionRange intersect(VersionRange r)

parseVersionRange

public static VersionRange parseVersionRange(String s)
                                      throws IllegalArgumentException
Parse a version range..

Parameters:
s -
Returns:
VersionRange object.
Throws:
IllegalArgumentException - if the String could not be parsed as a VersionRange

parseVersionRange

public static VersionRange parseVersionRange(String s,
                                             boolean exactVersion)
                                      throws IllegalArgumentException
Parse a version range and indicate if the version is an exact version

Parameters:
s -
exactVersion -
Returns:
VersionRange object.
Throws:
IllegalArgumentException - if the String could not be parsed as a VersionRange


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.