|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tools.ant.util.DeweyDecimal
public class DeweyDecimal
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.
Constructor Summary | |
---|---|
DeweyDecimal(int[] components)
Construct a DeweyDecimal from an array of integer components. |
|
DeweyDecimal(java.lang.String string)
Construct a DeweyDecimal from string in DeweyDecimal format. |
Method Summary | |
---|---|
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 . |
java.lang.String |
toString()
Return string representation of DeweyDecimal . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DeweyDecimal(int[] components)
components
- an array of integer components.public DeweyDecimal(java.lang.String string) throws java.lang.NumberFormatException
string
- the string in dewey decimal format
java.lang.NumberFormatException
- if string is malformedMethod Detail |
---|
public int getSize()
DeweyDecimal
.
public int get(int index)
index
- the index of components
public boolean isEqual(DeweyDecimal other)
true
if this DeweyDecimal
is
equal to the other DeweyDecimal
.
other
- the other DeweyDecimal
public boolean isLessThan(DeweyDecimal other)
true
if this DeweyDecimal
is
less than the other DeweyDecimal
.
other
- the other DeweyDecimal
public boolean isLessThanOrEqual(DeweyDecimal other)
true
if this DeweyDecimal
is
less than or equal to the other DeweyDecimal
.
other
- the other DeweyDecimal
public boolean isGreaterThan(DeweyDecimal other)
true
if this DeweyDecimal
is
greater than the other DeweyDecimal
.
other
- the other DeweyDecimal
public boolean isGreaterThanOrEqual(DeweyDecimal other)
true
if this DeweyDecimal
is
greater than or equal to the other DeweyDecimal
.
other
- the other DeweyDecimal
public java.lang.String toString()
DeweyDecimal
.
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |