org.knopflerfish.framework.VersionRange Class Reference

List of all members.


Detailed Description

Class representing OSGi version ranges.

Author:
Jan Stein

Definition at line 44 of file VersionRange.java.


Public Member Functions

 VersionRange (String vr) throws NumberFormatException
 Construct a VersionRange object.
boolean withinRange (Version ver)
 Check if specified version is within our range.
boolean withinRange (VersionRange range)
 Check if objects range is within another VersionRange.
int compareTo (Object obj) throws ClassCastException
 Compare object to another VersionRange.
String toString ()
 String with version number.
boolean equals (Object obj) throws ClassCastException
 Check if object is equal to this object.
int hashCode ()
 Hash code for this package entry.

Static Public Attributes

static final VersionRange defaultVersionRange = new VersionRange()
 The empty version range "[0.0.0,inf)".

Protected Member Functions

 VersionRange ()
 Construct the default VersionRange object.

Constructor & Destructor Documentation

org.knopflerfish.framework.VersionRange.VersionRange ( String  vr  )  throws NumberFormatException

Construct a VersionRange object.

Format for a range: ( "(" | "[" ) LOW_VERSION "," HIGH_VERSION ( ")" | "]" ) Format for at least a version: VERSION

Parameters:
vr Input string.

Definition at line 65 of file VersionRange.java.


Member Function Documentation

boolean org.knopflerfish.framework.VersionRange.withinRange ( Version  ver  ) 

Check if specified version is within our range.

Parameters:
ver Version to compare to.
Returns:
Return true if within range, otherwise false.

Definition at line 114 of file VersionRange.java.

References org.osgi.framework.Version.compareTo(), and org.knopflerfish.framework.VersionRange.defaultVersionRange.

Referenced by org.knopflerfish.framework.Bundles.getBundles(), org.knopflerfish.framework.ImportPkg.okPackageVersion(), and org.knopflerfish.framework.ImportPkg.overlap().

boolean org.knopflerfish.framework.VersionRange.withinRange ( VersionRange  range  ) 

Check if objects range is within another VersionRange.

Parameters:
range VersionRange to compare to.
Returns:
Return true if within range, otherwise false.

Definition at line 137 of file VersionRange.java.

References org.osgi.framework.Version.compareTo(), org.knopflerfish.framework.VersionRange.high, org.knopflerfish.framework.VersionRange.highIncluded, org.knopflerfish.framework.VersionRange.low, and org.knopflerfish.framework.VersionRange.lowIncluded.

int org.knopflerfish.framework.VersionRange.compareTo ( Object  obj  )  throws ClassCastException

Compare object to another VersionRange.

VersionRanges are compared on the lower bound.

Parameters:
obj VersionRange to compare to.
Returns:
Return 0 if equals, negative if this object is less than obj and positive if this object is larger then obj.
Exceptions:
ClassCastException if object is not a VersionRange object.

Definition at line 163 of file VersionRange.java.

References org.osgi.framework.Version.compareTo(), and org.knopflerfish.framework.VersionRange.low.

String org.knopflerfish.framework.VersionRange.toString (  ) 

String with version number.

If version is not specified return an empty string.

Returns:
String.

Definition at line 175 of file VersionRange.java.

References org.osgi.framework.Version.toString().

boolean org.knopflerfish.framework.VersionRange.equals ( Object  obj  )  throws ClassCastException

Check if object is equal to this object.

Parameters:
obj Package entry to compare to.
Returns:
true if equal, otherwise false.

Definition at line 204 of file VersionRange.java.

References org.osgi.framework.Version.equals(), org.knopflerfish.framework.VersionRange.high, org.knopflerfish.framework.VersionRange.highIncluded, org.knopflerfish.framework.VersionRange.low, and org.knopflerfish.framework.VersionRange.lowIncluded.

Referenced by org.knopflerfish.framework.ImportPkg.ImportPkg().

int org.knopflerfish.framework.VersionRange.hashCode (  ) 

Hash code for this package entry.

Returns:
int value.

Definition at line 224 of file VersionRange.java.

References org.osgi.framework.Version.hashCode().


The documentation for this class was generated from the following file:
Generated on Mon Jan 11 21:19:19 2010 for OpenMobileIS by  doxygen 1.5.4