@ApiAudience.Public @ApiStability.Unstable public class Aer extends java.lang.Object implements java.lang.Comparable<Aer>
Modifier and Type | Class and Description |
---|---|
static class |
Aer.Unit
An unit to represent aergo.
|
Modifier and Type | Field and Description |
---|---|
static Aer |
AERGO_ONE |
static Aer |
EMPTY |
static java.lang.String |
EMPTY_STRING |
static Aer |
GIGA_ONE |
static Aer |
ONE |
protected java.math.BigInteger |
value |
static Aer |
ZERO |
Modifier | Constructor and Description |
---|---|
protected |
Aer() |
|
Aer(java.math.BigInteger amount)
Aer constructor.
|
|
Aer(java.lang.String amount)
Create
Aer instance. |
|
Aer(java.lang.String amount,
Aer.Unit unit)
Create
Aer instance. |
Modifier and Type | Method and Description |
---|---|
Aer |
add(Aer other)
Returns a Aer whose value is
(this.value + other.value) . |
int |
compareTo(Aer other)
.
|
static Aer |
of(java.math.BigInteger amount)
Create an
Aer instance. |
static Aer |
of(java.lang.String amount)
Create
Aer instance. |
static Aer |
of(java.lang.String amount,
Aer.Unit unit)
Create
Aer instance. |
protected java.math.BigInteger |
parse(java.lang.String value,
Aer.Unit unit) |
Aer |
subtract(Aer other)
Returns a Aer whose value is
(this.value - other.value) . |
java.lang.String |
toString() |
java.lang.String |
toString(Aer.Unit unit)
Convert aer with
unit . |
public static final java.lang.String EMPTY_STRING
public static final Aer EMPTY
public static final Aer ZERO
public static final Aer ONE
public static final Aer GIGA_ONE
public static final Aer AERGO_ONE
protected final java.math.BigInteger value
protected Aer()
@ApiAudience.Public public Aer(java.lang.String amount)
Aer
instance.amount
- an amount in string which is considered as Aer.Unit.AER
@ApiAudience.Public public Aer(java.lang.String amount, Aer.Unit unit)
Aer
instance.amount
- an amount in stringunit
- an unit Aer.Unit
@ApiAudience.Public public Aer(java.math.BigInteger amount)
amount
- an amount in Aer.Unit.AER
@ApiAudience.Public public static Aer of(java.lang.String amount)
Aer
instance.amount
- an amount in string which is considered as Aer.Unit.AER
@ApiAudience.Public public static Aer of(java.lang.String amount, Aer.Unit unit)
Aer
instance.amount
- an amount in stringunit
- an unit Aer.Unit
@ApiAudience.Public public static Aer of(java.math.BigInteger amount)
Aer
instance.amount
- an amount in Aer.Unit.AER
protected java.math.BigInteger parse(java.lang.String value, Aer.Unit unit)
public Aer add(Aer other)
(this.value + other.value)
.other
- value to be added to this aer.this.value + other.value
public Aer subtract(Aer other)
(this.value - other.value)
. If a subtracted value is less
than 0, return 0 Aer.Unit.AER
.other
- value to be added to this aer.this.value - other.value
public int compareTo(Aer other)
compareTo
in interface java.lang.Comparable<Aer>
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(Aer.Unit unit)
unit
.unit
- an aergo unitunit