|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.springsource.util.osgi.VersionRange
public final class VersionRange
Parses the String
specification a range of Versions
as defined in ?3.2.5 of the OSGi
Service Server Core Specification.
VersionRange
can be queried to see if it includes a particular Version
using
includes(Version)
.
Distinct representations of an empty range are regarded as equal.
Concurrent Semantics
Field Summary | |
---|---|
private org.osgi.framework.Version |
ceiling
|
private boolean |
ceilingInclusive
|
private static char |
EXCLUSIVE_LOWER
|
private static char |
EXCLUSIVE_UPPER
|
private org.osgi.framework.Version |
floor
|
private boolean |
floorInclusive
|
private static char |
INCLUSIVE_LOWER
|
private static char |
INCLUSIVE_UPPER
|
static VersionRange |
NATURAL_NUMBER_RANGE
|
private static org.osgi.framework.Version |
ZERO_VERSION
|
Constructor Summary | |
---|---|
private |
VersionRange(boolean floorInclusive,
org.osgi.framework.Version floor,
org.osgi.framework.Version ceiling,
boolean ceilingInclusive)
|
|
VersionRange(java.lang.String versionRange)
Creates a VersionRange for the provided specification. |
Method Summary | |
---|---|
static VersionRange |
createExactRange(org.osgi.framework.Version version)
Creates a VersionRange that encompasses the supplied version, and only the supplied version:
[version, version] . |
boolean |
equals(java.lang.Object object)
|
org.osgi.framework.Version |
getCeiling()
Gets the ceiling of this VersionRange . |
org.osgi.framework.Version |
getFloor()
Gets the floor of this VersionRange . |
int |
hashCode()
|
boolean |
includes(org.osgi.framework.Version version)
Queries whether this VersionRange includes the supplied Version . |
static VersionRange |
intersection(VersionRange rangeOne,
VersionRange rangeTwo)
Returns a VersionRange that is the intersection of the two supplied VersionRanges . |
boolean |
isCeilingInclusive()
Indicates whether or not the ceiling of this VersionRange is inclusive. |
boolean |
isEmpty()
|
boolean |
isExact()
Queries whether this VersionRange is an exact range containing a single version. |
boolean |
isFloorInclusive()
Indicates whether or not the floor of this VersionRange is inclusive. |
static VersionRange |
naturalNumberRange()
Creates a VersionRange encompassing all the natural numbers: [0.0.0, ?) . |
java.lang.String |
toParseString()
Creates a String representation of this VersionRange that can be re-parsed. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final org.osgi.framework.Version ZERO_VERSION
private static final char INCLUSIVE_LOWER
private static final char INCLUSIVE_UPPER
private static final char EXCLUSIVE_LOWER
private static final char EXCLUSIVE_UPPER
public static final VersionRange NATURAL_NUMBER_RANGE
private final org.osgi.framework.Version floor
private final org.osgi.framework.Version ceiling
private final boolean floorInclusive
private final boolean ceilingInclusive
Constructor Detail |
---|
public VersionRange(java.lang.String versionRange)
VersionRange
for the provided specification.
versionRange
- the VersionRange
specification.private VersionRange(boolean floorInclusive, org.osgi.framework.Version floor, org.osgi.framework.Version ceiling, boolean ceilingInclusive)
Method Detail |
---|
public static VersionRange naturalNumberRange()
VersionRange
encompassing all the natural numbers: [0.0.0, ?)
.
VersionRange
encompassing all the natural numbers.public static VersionRange createExactRange(org.osgi.framework.Version version)
VersionRange
that encompasses the supplied version, and only the supplied version:
[version, version]
.
version
- The version for which an exact range is required.
public org.osgi.framework.Version getFloor()
VersionRange
.
VersionRange
.public org.osgi.framework.Version getCeiling()
VersionRange
. The returned Version
is null
if and
only if this VersionRange
is unbounded.
VersionRange
or null
if the range is unbounded.public boolean isFloorInclusive()
VersionRange
is inclusive.
true
if the floor is inclusive; otherwise false
.public boolean isCeilingInclusive()
VersionRange
is inclusive.
true
if the ceiling is inclusive; otherwise false
.public boolean includes(org.osgi.framework.Version version)
VersionRange
includes the supplied Version
.
version
- the Version
to check against.
true
if the Version
is included in this VersionRange
; otherwise
false
.public boolean isExact()
VersionRange
is an exact range containing a single version.
true
if and only if this code>VersionRange is exactpublic boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public boolean isEmpty()
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toParseString()
String
representation of this VersionRange
that can be re-parsed.
public static VersionRange intersection(VersionRange rangeOne, VersionRange rangeTwo)
VersionRange
that is the intersection of the two supplied VersionRanges
.
rangeOne
- The first VersionRange
for the intersectionrangeTwo
- The second VersionRange
for the intersection
VersionRanges
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |