Package org.apache.ivy.plugins.parser.m2
Class MavenVersionRangeParser.DeweyDecimal
java.lang.Object
org.apache.ivy.plugins.parser.m2.MavenVersionRangeParser.DeweyDecimal
- Enclosing class:
- MavenVersionRangeParser
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]
Array of components that make up DeweyDecimal -
Constructor Summary
ConstructorsConstructorDescriptionDeweyDecimal
(int[] components) Construct a DeweyDecimal from an array of integer components.DeweyDecimal
(String string) Construct a DeweyDecimal from string in DeweyDecimal format. -
Method Summary
Modifier and TypeMethodDescriptionint
Compares this DeweyDecimal with another one.boolean
int
get
(int index) Return the component at specified index.int
getSize()
Return number of components inDeweyDecimal
.int
hashCode()
boolean
Returntrue
if thisDeweyDecimal
is equal to the otherDeweyDecimal
.boolean
Returntrue
if thisDeweyDecimal
is greater than the otherDeweyDecimal
.boolean
Returntrue
if thisDeweyDecimal
is greater than or equal to the otherDeweyDecimal
.boolean
Returntrue
if thisDeweyDecimal
is less than the otherDeweyDecimal
.boolean
Returntrue
if thisDeweyDecimal
is less than or equal to the otherDeweyDecimal
.toString()
Return string representation ofDeweyDecimal
.
-
Field Details
-
components
private final int[] componentsArray of components that make up DeweyDecimal
-
-
Constructor Details
-
DeweyDecimal
public DeweyDecimal(int[] components) Construct a DeweyDecimal from an array of integer components.- Parameters:
components
- an array of integer components.
-
DeweyDecimal
Construct a DeweyDecimal from string in DeweyDecimal format.- Parameters:
string
- the string in dewey decimal format- Throws:
NumberFormatException
- if string is malformed
-
-
Method Details
-
getSize
public int getSize()Return number of components inDeweyDecimal
.- Returns:
- the number of components in dewey decimal
-
get
public int get(int index) Return the component at specified index.- Parameters:
index
- the index of components- Returns:
- the value of component at index
-
isEqual
Returntrue
if thisDeweyDecimal
is equal to the otherDeweyDecimal
.- Parameters:
other
- the other DeweyDecimal- Returns:
- true if equal to other DeweyDecimal, false otherwise
-
isLessThan
Returntrue
if thisDeweyDecimal
is less than the otherDeweyDecimal
.- Parameters:
other
- the other DeweyDecimal- Returns:
- true if less than other DeweyDecimal, false otherwise
-
isLessThanOrEqual
Returntrue
if thisDeweyDecimal
is less than or equal to the otherDeweyDecimal
.- Parameters:
other
- the other DeweyDecimal- Returns:
- true if less than or equal to other DeweyDecimal, false otherwise
-
isGreaterThan
Returntrue
if thisDeweyDecimal
is greater than the otherDeweyDecimal
.- Parameters:
other
- the other DeweyDecimal- Returns:
- true if greater than other DeweyDecimal, false otherwise
-
isGreaterThanOrEqual
Returntrue
if thisDeweyDecimal
is greater than or equal to the otherDeweyDecimal
.- Parameters:
other
- the other DeweyDecimal- Returns:
- true if greater than or equal to other DeweyDecimal, false otherwise
-
toString
Return string representation ofDeweyDecimal
. -
compareTo
Compares this DeweyDecimal with another one.- Parameters:
other
- another DeweyDecimal to compare with- Returns:
- result
- See Also:
-
hashCode
public int hashCode() -
equals
-