| Constructor and Description |
|---|
SignedAddSubInt() |
SignedAddSubInt(SignedAddSubInt a)
Copy constructor; a deep copy should be performed.
|
SignedAddSubInt(java.lang.String a)
This is a constructor that construct an AddSubInt with value presented
by the input string.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(BigInt b)
Add an SignedAddSubInt mx into this BigInt.
|
static SignedAddSubInt |
add(SignedAddSubInt a,
SignedAddSubInt b)
The method should not have side-effect.
|
int |
compareTo(BigInt b)
Override the default compareTo method
|
void |
subtract(BigInt b)
Students don't have to implement this method for Asg3.
|
static SignedAddSubInt |
subtract(SignedAddSubInt a,
SignedAddSubInt b) |
java.lang.String |
toString()
Override the default toString method
|
java.lang.String |
toString(int w) |
add, div, equals, timespublic SignedAddSubInt()
public SignedAddSubInt(java.lang.String a)
a - is a string such as "000123400"public SignedAddSubInt(SignedAddSubInt a)
a - to be copiedpublic static SignedAddSubInt add(SignedAddSubInt a, SignedAddSubInt b)
a - is AddSubIntb - is AddSubIntpublic static SignedAddSubInt subtract(SignedAddSubInt a, SignedAddSubInt b)
public void add(BigInt b)
add in interface BigIntadd in class AdditionOnlyIntb - is a BigInt, some type casting is necessarypublic void subtract(BigInt b)
AdditionOnlyIntpublic int compareTo(BigInt b)
compareTo in interface java.lang.Comparable<BigInt>compareTo in class AdditionOnlyIntb - is expected to be a BigInt to work correctlypublic java.lang.String toString()
AdditionOnlyInttoString in class AdditionOnlyIntpublic java.lang.String toString(int w)
w - is the length of the returned string using right alignment