| Constructor and Description |
|---|
AdditionOnlyInt()
This is the default constructor set the value to "0";
|
AdditionOnlyInt(AdditionOnlyInt a)
Copy constructor; a deep copy should be performed.
|
AdditionOnlyInt(java.lang.String a)
This is a constructor that construct an AdditionOnlyInt with value presented
by the input string.
|
| Modifier and Type | Method and Description |
|---|---|
static AdditionOnlyInt |
add(AdditionOnlyInt a,
AdditionOnlyInt b)
The method should not have side-effect.
|
void |
add(BigInt mx)
Add an AdditionOnlyInt mx into this BigInt.
|
int |
compareTo(BigInt o)
Override the default compareTo method
|
void |
div(BigInt b,
BigInt r)
Students don't have to implement this method for Asg3.
|
boolean |
equals(java.lang.Object o)
Override the default equals method
|
void |
subtract(BigInt s)
Students don't have to implement this method for Asg3.
|
void |
times(BigInt a)
Students don't have to implement this method for Asg3.
|
java.lang.String |
toString()
Override the default toString method
|
public AdditionOnlyInt()
public AdditionOnlyInt(java.lang.String a)
a - is a string such as "00012340"public AdditionOnlyInt(AdditionOnlyInt a)
a - to be copiedpublic int compareTo(BigInt o)
compareTo in interface java.lang.Comparable<BigInt>o - is expected to be a BigInt to work correctlypublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic void add(BigInt mx)
public static AdditionOnlyInt add(AdditionOnlyInt a, AdditionOnlyInt b)
a - is AdditionOnlyIntb - is AdditionOnlyIntpublic java.lang.String toString()
toString in class java.lang.Objectpublic void subtract(BigInt s)
public void times(BigInt a)