public class StructuredNumber extends Object implements Comparable<StructuredNumber>
Modifier and Type | Field and Description |
---|---|
int[] |
components
The component array
|
Constructor and Description |
---|
StructuredNumber(int n)
Out-of-integer ctor.
|
StructuredNumber(String sn)
Out-of-string ctor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(StructuredNumber sn)
Comparison method.
|
StructuredNumber |
createCopy() |
StructuredNumber |
createCopyWithSuffix(int number)
Creates a copy of this StructuredNumber, appending the given number.
|
boolean |
equals(StructuredNumber sn)
Checks if this StructuredNumber is equal to the given one.
|
String |
getString() |
String |
toString() |
public StructuredNumber(String sn)
sn
- string of the form x.y.zpublic StructuredNumber(int n)
n
- integer valuepublic int compareTo(StructuredNumber sn)
compareTo
in interface Comparable<StructuredNumber>
sn
- other structured number to compare withpublic String getString()
public StructuredNumber createCopyWithSuffix(int number)
number
- the integer to appendpublic StructuredNumber createCopy()
public boolean equals(StructuredNumber sn)
sn
- Copyright © 2018. All rights reserved.