org.apache.tools.ant.taskdefs.optional.extension
Class DeweyDecimal
java.lang.Object
org.apache.tools.ant.taskdefs.optional.extension.DeweyDecimal
public final class DeweyDecimal
extends java.lang.Object
Utility class to contain version numbers in "Dewey Decimal"
syntax. Numbers in the "Dewey Decimal" syntax consist of positive
decimal integers separated by periods ".". For example, "2.0" or
"1.2.3.4.5.6.7". This allows an extensible number to be used to
represent major, minor, micro, etc versions. The version number
must begin with a number.
Version:
DeweyDecimal(String string) - Construct a DeweyDecimal from string in DeweyDecimal format.
|
DeweyDecimal(int[] components) - Construct a DeweyDecimal from an array of integer components.
|
int | get(int index) - Return the component at specified index.
|
int | getSize() - Return number of components in
DeweyDecimal .
|
boolean | isEqual(DeweyDecimal other) - Return
true if this DeweyDecimal is
equal to the other DeweyDecimal .
|
boolean | isGreaterThan(DeweyDecimal other) - Return
true if this DeweyDecimal is
greater than the other DeweyDecimal .
|
boolean | isGreaterThanOrEqual(DeweyDecimal other) - Return
true if this DeweyDecimal is
greater than or equal to the other DeweyDecimal .
|
boolean | isLessThan(DeweyDecimal other) - Return
true if this DeweyDecimal is
less than the other DeweyDecimal .
|
boolean | isLessThanOrEqual(DeweyDecimal other) - Return
true if this DeweyDecimal is
less than or equal to the other DeweyDecimal .
|
String | toString() - Return string representation of
DeweyDecimal .
|
DeweyDecimal
public DeweyDecimal(String string)
throws NumberFormatException
Construct a DeweyDecimal from string in DeweyDecimal format.
string
- the string in dewey decimal format
DeweyDecimal
public DeweyDecimal(int[] components)
Construct a DeweyDecimal from an array of integer components.
components
- an array of integer components.
get
public int get(int index)
Return the component at specified index.
index
- the index of components
- the value of component at index
getSize
public int getSize()
Return number of components in DeweyDecimal
.
- the number of components in dewey decimal
isEqual
public boolean isEqual(DeweyDecimal other)
Return true
if this DeweyDecimal
is
equal to the other DeweyDecimal
.
other
- the other DeweyDecimal
- true if equal to other DeweyDecimal, false otherwise
isGreaterThan
public boolean isGreaterThan(DeweyDecimal other)
Return true
if this DeweyDecimal
is
greater than the other DeweyDecimal
.
other
- the other DeweyDecimal
- true if greater than other DeweyDecimal, false otherwise
isGreaterThanOrEqual
public boolean isGreaterThanOrEqual(DeweyDecimal other)
Return true
if this DeweyDecimal
is
greater than or equal to the other DeweyDecimal
.
other
- the other DeweyDecimal
- true if greater than or equal to other DeweyDecimal, false otherwise
isLessThan
public boolean isLessThan(DeweyDecimal other)
Return true
if this DeweyDecimal
is
less than the other DeweyDecimal
.
other
- the other DeweyDecimal
- true if less than other DeweyDecimal, false otherwise
isLessThanOrEqual
public boolean isLessThanOrEqual(DeweyDecimal other)
Return true
if this DeweyDecimal
is
less than or equal to the other DeweyDecimal
.
other
- the other DeweyDecimal
- true if less than or equal to other DeweyDecimal, false otherwise
toString
public String toString()
Return string representation of DeweyDecimal
.
- the string representation of DeweyDecimal.
Copyright B) 2000-2005 Apache Software Foundation. All Rights Reserved.