com.meyling.principia.module
Class Version
java.lang.Object
|
+--com.meyling.principia.argument.AbstractArgument
|
+--com.meyling.principia.argument.AbstractArgumentList
|
+--com.meyling.principia.module.Version
- All Implemented Interfaces:
- Argument, Textable
- public class Version
- extends AbstractArgumentList
- implements Argument, Textable
A version description.
- Version:
- $Revision: 1.5 $
- Author:
- Michael Meyling
Constructor Summary |
Version(Argument[] arguments)
Constructs a version description. |
Version(String version)
Constructs a version description. |
Methods inherited from class com.meyling.principia.argument.AbstractArgument |
containsPatternVariables, equals, getHighestNumber, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches |
Methods inherited from interface com.meyling.principia.argument.Argument |
containsPatternVariables, copy, equals, getArgument, getArgumentSize, getPatternVariables, getReplacementParents, getSearchParents, hashCode, matches, matches, replace, replace, replace, replaceMatches |
Version
public Version(Argument[] arguments)
throws ArgumentException
- Constructs a version description.
- Parameters:
arguments
- Text
to be a version description- Throws:
ArgumentException
- if there is not exactly one
argument or the first argument is not an instance
of Text
or it isn't build of digits and
periods in the following form: n.nn.nn(.nn)*
Version
public Version(String version)
throws ArgumentException
- Constructs a version description.
- Parameters:
version
- version- Throws:
ArgumentException
- if version it isn't build of digits and
periods in the following form: n.nn.nn(.nn)*
greaterThan
public final boolean greaterThan(Version v)
- Check if this version is greater than another one
- Parameters:
v
- version to compare with- Returns:
- is this version greater than
v
?
equalWith
public final boolean equalWith(Version v)
- Check if this version is equal to another one.
This method would return true for the versions
"1.001.00" and "1.1".
- Parameters:
v
- version to compare with- Returns:
- is this version the same as
v
?
getText
public final String getText()
- Description copied from interface:
Textable
- Get label of object.
- Specified by:
getText
in interface Textable
- Following copied from interface:
com.meyling.principia.module.Textable
- Returns:
- label of object
create
public final Argument create(Argument[] arguments)
throws ArgumentException
- Description copied from interface:
Argument
- Create a new Argument with given arguments.
- Specified by:
create
in interface Argument
- Overrides:
create
in class AbstractArgumentList
- Following copied from interface:
com.meyling.principia.argument.Argument
- Parameters:
arguments
- with these arguments the operator should
be created- Returns:
- new constructed Argument
- Throws:
ArgumentException
- if creation failed
toString
public final String toString()
- Description copied from interface:
Argument
- Get the argument in
String
form.
- Specified by:
toString
in interface Argument
- Overrides:
toString
in class AbstractArgumentList
- Following copied from interface:
com.meyling.principia.argument.Argument
- Returns:
- readable formula