public final class ArbitrarilyBigInteger extends GenericInteger
BigInteger
. See
https://jaxb.java.net/tutorial/section_2_2_2-Numeric-Types.htmlConstructor and Description |
---|
ArbitrarilyBigInteger(BigInteger value)
Creates instance from integer argument
|
ArbitrarilyBigInteger(long val)
Creates instance from long argument, mostly for easy writing of tests
|
Modifier and Type | Method and Description |
---|---|
ArbitrarilyBigInteger |
abs()
Returns the absolute value of
this . |
ArbitrarilyBigInteger |
add(GenericInteger other)
Add integer to this.
|
BigInteger |
bigIntegerValue()
Convert to BigInteger
|
int |
compareTo(GenericInteger o) |
ArbitrarilyBigInteger |
divide(GenericInteger divisor)
Divide
this by some other number. |
double |
doubleValue() |
boolean |
equals(Object obj) |
float |
floatValue() |
int |
hashCode() |
int |
intValue() |
int |
intValueExact()
Converts this value to a primitive int safely, i.e.
|
long |
longValue() |
long |
longValueExact()
Converts this value to a primitive long safely, i.e.
|
ArbitrarilyBigInteger |
multiply(GenericInteger other)
Multiply
this by another integer. |
ArbitrarilyBigInteger |
remainder(GenericInteger divisor)
Returns this %
divisor |
ArbitrarilyBigInteger |
subtract(GenericInteger subtractedVal)
Subtract a number from this.
|
static ArbitrarilyBigInteger |
valueOf(BigInteger big)
Returns an
ArbitrarilyBigInteger instance representing the specified big integer value |
byteValue, shortValue
public ArbitrarilyBigInteger(BigInteger value)
value
- Java equivalent of xsd:integerpublic ArbitrarilyBigInteger(long val)
Be aware that type long is not equivalent to xsd:integer type, BigInteger is. See https://jaxb.java.net/tutorial/section_2_2_2-Numeric-Types.html
val
- integer value as Java longpublic static ArbitrarilyBigInteger valueOf(BigInteger big)
ArbitrarilyBigInteger
instance representing the specified big integer valuebig
- integerbig
public float floatValue()
floatValue
in class Number
public BigInteger bigIntegerValue()
GenericInteger
bigIntegerValue
in class GenericInteger
BigInteger
public int intValueExact() throws ArithmeticException
GenericInteger
intValueExact
in class GenericInteger
ArithmeticException
- if the value of this will not exactly fit into an int.public long longValueExact()
GenericInteger
longValueExact
in class GenericInteger
public int compareTo(GenericInteger o)
public ArbitrarilyBigInteger abs()
this
. Used by the XACML "abs" functions.abs
in class GenericInteger
public ArbitrarilyBigInteger add(GenericInteger other)
add
in class GenericInteger
other
- value to add to this valuepublic ArbitrarilyBigInteger multiply(GenericInteger other) throws ArithmeticException
this
by another integer. Used by the XACML "multiply" functions.multiply
in class GenericInteger
other
- factor (other integer to multiply by)ArithmeticException
- if the result overflows the value space of this typepublic ArbitrarilyBigInteger divide(GenericInteger divisor) throws ArithmeticException
this
by some other number. Used by XACML *-divide functions.divide
in class GenericInteger
divisor
- number by which this
is dividedArithmeticException
- if divisor is zeropublic ArbitrarilyBigInteger subtract(GenericInteger subtractedVal)
subtract
in class GenericInteger
subtractedVal
- value to be subtracted from this
public ArbitrarilyBigInteger remainder(GenericInteger divisor) throws ArithmeticException
GenericInteger
divisor
remainder
in class GenericInteger
divisor
- second argumentArithmeticException
- if divisor is zeropublic double doubleValue() throws IllegalArgumentException
doubleValue
in class Number
IllegalArgumentException
Copyright © 2012–2020. All rights reserved.