Package ch.bitagent.bitcoin.lib.ecc
Class Int
- java.lang.Object
-
- ch.bitagent.bitcoin.lib.ecc.Int
-
- All Implemented Interfaces:
PointOperators,Comparable<Int>
- Direct Known Subclasses:
Hex
public class Int extends Object implements PointOperators, Comparable<Int>
An Integer based on BigInteger with Point Operators
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedInt(String i, int radix)Constructor for Int.protectedInt(BigInteger bi)Constructor for Int.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Intadd(PointOperators otherPoint)add.BigIntegerbigInt()bigInt.intcompareTo(Int other)Intdiv(PointOperators otherPoint)div.booleaneq(PointOperators otherPoint)eq.booleanequals(Object o)booleange(Int otherInt)ge.booleangt(Int otherInt)gt.inthashCode()intintValue()intValue.booleanle(Int otherInt)le.static Intlog(Int i)Deprecated.temp use onlylonglongValue()longValue.booleanlt(Int otherInt)lt.Intmod(Int divisor)mod.PointOperatorsmul(int coefficient)mul.Intmul(PointOperators otherPoint)mul.booleanne(PointOperators otherPoint)ne.static Intparse(int i)parse.static Intparse(long i)parse.static Intparse(String i)parse.static Intparse(BigInteger bi)parse.Intpow(Int exponent)pow.IntpowMod(Int exponent, Int divisor)powMod.Intsub(PointOperators otherPoint)sub.byte[]toBytes()toBytes.byte[]toBytes(int length)toBytes.byte[]toBytesLittleEndian()toBytesLittleEndian.byte[]toBytesLittleEndian(int length)toBytesLittleEndian.HextoHex()toHex.ScriptCmdtoScriptCmd()toScriptCmd.StringtoString()
-
-
-
Constructor Detail
-
Int
protected Int(String i, int radix)
Constructor for Int.
- Parameters:
i- aStringobjectradix- a int
-
Int
protected Int(BigInteger bi)
Constructor for Int.
- Parameters:
bi- aBigIntegerobject
-
-
Method Detail
-
parse
public static Int parse(BigInteger bi)
parse.
- Parameters:
bi- a big integer- Returns:
- a
Intobject
-
eq
public boolean eq(PointOperators otherPoint)
eq.
- Specified by:
eqin interfacePointOperators- Parameters:
otherPoint- aPointOperatorsobject- Returns:
- a boolean
-
ne
public boolean ne(PointOperators otherPoint)
ne.
- Specified by:
nein interfacePointOperators- Parameters:
otherPoint- aPointOperatorsobject- Returns:
- a boolean
-
add
public Int add(PointOperators otherPoint)
add.
- Specified by:
addin interfacePointOperators- Parameters:
otherPoint- aPointOperatorsobject- Returns:
- a
PointOperatorsobject
-
sub
public Int sub(PointOperators otherPoint)
sub.
- Specified by:
subin interfacePointOperators- Parameters:
otherPoint- aPointOperatorsobject- Returns:
- a
PointOperatorsobject
-
mul
public Int mul(PointOperators otherPoint)
mul.
- Specified by:
mulin interfacePointOperators- Parameters:
otherPoint- aPointOperatorsobject- Returns:
- a
PointOperatorsobject
-
mul
public PointOperators mul(int coefficient)
mul.
- Specified by:
mulin interfacePointOperators- Parameters:
coefficient- a int- Returns:
- a
PointOperatorsobject
-
pow
public Int pow(Int exponent)
pow.
- Specified by:
powin interfacePointOperators- Parameters:
exponent- aIntobject- Returns:
- a
PointOperatorsobject
-
div
public Int div(PointOperators otherPoint)
div.
- Specified by:
divin interfacePointOperators- Parameters:
otherPoint- aPointOperatorsobject- Returns:
- a
PointOperatorsobject
-
mod
public Int mod(Int divisor)
mod.
- Specified by:
modin interfacePointOperators- Parameters:
divisor- aIntobject- Returns:
- a
PointOperatorsobject
-
powMod
public Int powMod(Int exponent, Int divisor)
powMod.
- Specified by:
powModin interfacePointOperators- Parameters:
exponent- aIntobjectdivisor- aIntobject- Returns:
- a
PointOperatorsobject
-
toBytes
public byte[] toBytes()
toBytes.
- Returns:
- an array of
byteobjects
-
toBytes
public byte[] toBytes(int length)
toBytes.
- Parameters:
length- a int- Returns:
- an array of
byteobjects
-
toBytesLittleEndian
public byte[] toBytesLittleEndian()
toBytesLittleEndian.
- Returns:
- an array of
byteobjects
-
toBytesLittleEndian
public byte[] toBytesLittleEndian(int length)
toBytesLittleEndian.
- Parameters:
length- a int- Returns:
- an array of
byteobjects
-
compareTo
public int compareTo(Int other)
- Specified by:
compareToin interfaceComparable<Int>
-
bigInt
public BigInteger bigInt()
bigInt.
- Returns:
- a
BigIntegerobject
-
intValue
public int intValue()
intValue.
- Returns:
- a int
-
longValue
public long longValue()
longValue.
- Returns:
- a long
-
-