YATS/Forge Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
cpw.mods.fml.common.versioning.VersionRange Class Reference

Public Member Functions

ArtifactVersion getRecommendedVersion ()
 
List< RestrictiongetRestrictions ()
 
VersionRange cloneOf ()
 
VersionRange restrict (VersionRange restriction)
 
String toString ()
 
ArtifactVersion matchVersion (List< ArtifactVersion > versions)
 
boolean containsVersion (ArtifactVersion version)
 
boolean hasRestrictions ()
 
boolean equals (Object obj)
 
int hashCode ()
 
boolean isUnboundedAbove ()
 
String getLowerBoundString ()
 

Static Public Member Functions

static VersionRange createFromVersionSpec (String spec) throws InvalidVersionSpecificationException
 
static VersionRange createFromVersion (String version, ArtifactVersion existing)
 

Detailed Description

Construct a version range from a specification.

Author
Brett Porter

Member Function Documentation

VersionRange cpw.mods.fml.common.versioning.VersionRange.cloneOf ( )
boolean cpw.mods.fml.common.versioning.VersionRange.containsVersion ( ArtifactVersion  version)
static VersionRange cpw.mods.fml.common.versioning.VersionRange.createFromVersion ( String  version,
ArtifactVersion  existing 
)
static
static VersionRange cpw.mods.fml.common.versioning.VersionRange.createFromVersionSpec ( String  spec) throws InvalidVersionSpecificationException
static

Create a version range from a string representation

Some spec examples are

  • 1.0 Version 1.0
  • [1.0,2.0) Versions 1.0 (included) to 2.0 (not included)
  • [1.0,2.0] Versions 1.0 to 2.0 (both included)
  • [1.5,) Versions 1.5 and higher
  • (,1.0],[1.2,) Versions up to 1.0 (included) and 1.2 or higher
Parameters
specstring representation of a version or version range
Returns
a new VersionRange object that represents the spec
Exceptions
InvalidVersionSpecificationException
boolean cpw.mods.fml.common.versioning.VersionRange.equals ( Object  obj)
String cpw.mods.fml.common.versioning.VersionRange.getLowerBoundString ( )
ArtifactVersion cpw.mods.fml.common.versioning.VersionRange.getRecommendedVersion ( )
List<Restriction> cpw.mods.fml.common.versioning.VersionRange.getRestrictions ( )
int cpw.mods.fml.common.versioning.VersionRange.hashCode ( )
boolean cpw.mods.fml.common.versioning.VersionRange.hasRestrictions ( )
boolean cpw.mods.fml.common.versioning.VersionRange.isUnboundedAbove ( )
ArtifactVersion cpw.mods.fml.common.versioning.VersionRange.matchVersion ( List< ArtifactVersion versions)
VersionRange cpw.mods.fml.common.versioning.VersionRange.restrict ( VersionRange  restriction)

Creates and returns a new VersionRange that is a restriction of this version range and the specified version range.

Note: Precedence is given to the recommended version from this version range over the recommended version from the specified version range.

Parameters
restrictionthe VersionRange that will be used to restrict this version range.
Returns
the VersionRange that is a restriction of this version range and the specified version range.

The restrictions of the returned version range will be an intersection of the restrictions of this version range and the specified version range if both version ranges have restrictions. Otherwise, the restrictions on the returned range will be empty.

The recommended version of the returned version range will be the recommended version of this version range, provided that ranges falls within the intersected restrictions. If the restrictions are empty, this version range's recommended version is used if it is not null. If it is null, the specified version range's recommended version is used (provided it is non-null). If no recommended version can be obtained, the returned version range's recommended version is set to null.

Exceptions
NullPointerExceptionif the specified VersionRange is null.
String cpw.mods.fml.common.versioning.VersionRange.toString ( )

The documentation for this class was generated from the following file: