|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmdx.kernel.environment.cci.VersionNumber
public final class VersionNumber
openMDX Version Number Class
| Field Summary | |
|---|---|
protected String |
external
|
protected int[] |
internal
|
| Constructor Summary | |
|---|---|
VersionNumber(int[] components)
Create the version number represented by the components |
|
VersionNumber(String version)
Creates a version based on its string representation. |
|
| Method Summary | |
|---|---|
Object |
clone()
|
int |
compareTo(Object object)
|
boolean |
equals(Object that)
|
int |
get(int index)
Retrieves a component of this verison number. |
VersionNumber |
getPrefix(int position)
Get a version number's prefix |
int |
hashCode()
|
boolean |
isCompliantWith(VersionNumber that)
Compliance test: The first components must be equal and the second component of this version number must be greater or equal than the second component of the other object. |
int |
size()
Get the number of components |
protected static String |
toExternal(int[] internal)
Get the external representation of the internal format. |
protected static int[] |
toInternal(String external,
boolean strict)
Parses the external format |
String |
toString()
|
static VersionNumber |
toVersionNumber(int[] components)
Create the version number represented by the components |
static VersionNumber |
toVersionNumber(String source)
Create a version number if the string represents one. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final int[] internal
protected final String external
| Constructor Detail |
|---|
public VersionNumber(String version)
version -
IllegalArgumentException - if the version string can't be parsed.public VersionNumber(int[] components)
components - an array of version number components, starting with the most
significant one
NullPointerException - if components is null| Method Detail |
|---|
public boolean isCompliantWith(VersionNumber that)
Positive examples:
that - public int size()
public int get(int index)
index - the 0-based index of the component to retrieve.
Must be in the range [0,size()).
ArrayIndexOutOfBoundsException - if index is outside the specified rangepublic VersionNumber getPrefix(int position)
IndexOutOfBoundsException - if position is greater than sizeprotected static String toExternal(int[] internal)
internal - the version number's internal representatiom
NullPointerException - if internal is
null.
protected static int[] toInternal(String external,
boolean strict)
external - the version number's external representationstrict - tells whether a parsing failure is signalled by
a BadParameterException or a null return value
IllegalArgumentException - in case of parsing failure if strict is truepublic static VersionNumber toVersionNumber(String source)
As opposed to VersionNumber(String) this method does not throw an exception in case of parse failure but returns null.
source -
public static VersionNumber toVersionNumber(int[] components)
components - an array of version number components, starting with the most
significant one
null if components is null
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic int compareTo(Object object)
compareTo in interface Comparablepublic boolean equals(Object that)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||