View Javadoc
1   package civitas.util;
2   
3   import java.math.BigInteger;
4   
5   public class CivitasBigintegerBase implements CivitasBigIntegerInterface {
6   
7   	public final BigInteger i;
8   
9   	public CivitasBigintegerBase(final BigInteger i) {
10  		this.i = i;
11  	}
12  
13  	public int bitLength() {
14  		return i.bitLength();
15  	}
16  
17  	public int intValue() {
18  		return i.intValue();
19  	}
20  
21  	public int compareTo(final CivitasBigInteger n) {
22  		return i.compareTo(n.i);
23  	}
24  
25  	@Override
26  	public String toString() {
27  		return i.toString();
28  	}
29  
30  	@Override
31  	public boolean equals(final Object object) {
32  		return object instanceof CivitasBigInteger other && this.i.equals(other.i);
33  	}
34  
35  	@Override
36  	public int hashCode() {
37  		return i.hashCode();
38  	}
39  
40  	public byte[] toByteArray() {
41  		return i.toByteArray();
42  	}
43  
44  	@Override
45  	public BigInteger asBigint() {
46  		return i;
47  	}
48  }