Interface Version
- All Superinterfaces:
Comparable<Version>, OsidPrimitive, Serializable
- All Known Subinterfaces:
Version
Supplements the OSID Version interface for Java.
-
Method Summary
Modifier and TypeMethodDescriptionintCompares this Version with the specified Version to determine the natural order.booleanDetermines if the givenVersionis equal to this one.inthashCode()Returns a hash code value for thisVersionbased on the schema and components.booleanisExclusive(Version version) Tests if this Version excludes the given version.booleanisInclusive(Version version) Tests if this Version includes the given version.booleanTests if this Version is more recent than the given Version.booleanTests if this Version is older than the given Version.Methods inherited from interface OsidPrimitive
toString
-
Method Details
-
isNewer
Tests if this Version is more recent than the given Version.- Parameters:
version- the version to compare- Returns:
trueif this version is more recent,falseotherwise- Throws:
NullArgumentException-versionisnullUnsupportedException- version scheme types not compatible
-
isOlder
Tests if this Version is older than the given Version.- Parameters:
version- the version to compare- Returns:
trueif this version is older,falseotherwise- Throws:
NullArgumentException-versionisnullUnsupportedException- version scheme types not compatible
-
isInclusive
Tests if this Version includes the given version. A version 3.2 may include version 3.2.5 but not include version 3.0.- Parameters:
version- the version to compare- Returns:
trueif this version includes the given version,falseotherwise- Throws:
NullArgumentException-versionisnullUnsupportedException- version scheme types not compatible
-
isExclusive
Tests if this Version excludes the given version. Two versions are exclusive if a.isInclusive(b) and b.isInclusive(c) are both false.- Parameters:
version- the version to compare- Returns:
trueif this version excludes the given version,falseotherwise- Throws:
NullArgumentException-versionisnullUnsupportedException- version scheme types not compatible
-
compareTo
Compares this Version with the specified Version to determine the natural order. Returns a negative integer, zero, or a positive integer as this version is less than, equal to, or greater than the specified version. The natural ordering is determined first by the natural ordering of the version scheme, then by its components. IfcompareToan version is zero, thenequals()must betrueand their hash codes must also be equal for consistent behavior. For orderings that may yield inconsistent behavior, an externalComparatorshould be used.- Specified by:
compareToin interfaceComparable<Version>- Parameters:
version- the version to be compared- Returns:
- a negative integer, zero, or a positive integer as this version is less than, equal to, or greater than the specified version
- Throws:
ClassCastException- if the specified version's type prevents it from being compared to this version
-
equals
Determines if the givenVersionis equal to this one. Two versions are equal if their schema and components are equal. Ifequals()istrue, thencompareTo()must be zero and their hash codes must also be equal for consistent behavior. For orderings that may yield inconsistent behavior, an externalComparatorshould be used. Ifobjis null or if a different interface, this method returnsfalse. -
hashCode
-