Package coneforest.psylla.core
Class PsyInteger
java.lang.Object
coneforest.psylla.core.PsyInteger
- All Implemented Interfaces:
PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyAtomic
,PsyBitwise<PsyIntegral>
,PsyConvertableToInteger
,PsyConvertableToIntegral
,PsyConvertableToName
,PsyConvertableToReal
,PsyConvertableToString
,PsyIntegral
,PsyLogical<PsyIntegral>
,PsyMultiplicative<PsyNumeric>
,PsyNumeric
,PsyObject
,PsyRational
,PsyRealNumeric
,PsyScalar<PsyRealNumeric>
A representation of
integer
object.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PsyInteger
Aninteger
representing the maximum representable value.static final PsyInteger
Aninteger
representing the minimum representable value.static final PsyInteger
Aninteger
representing the number −1.static final PsyInteger
Aninteger
representing the number 1.static final PsyInteger
Aninteger
representing the number 2.static final PsyInteger
Aninteger
representing the number 0.Fields inherited from interface coneforest.psylla.core.PsyBitwise
OPERATORS
Fields inherited from interface coneforest.psylla.core.PsyIntegral
OPERATORS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
boolean
int
hashCode()
int
intValue()
long
static PsyInteger
of
(long integer) psyAbs()
Returns anumeric
absolute value of this object.psyAdd
(PsyRealNumeric oNumeric) psyAnd
(PsyIntegral oIntegral) Returns a result of logical conjunction of this object and given object.psyBitShift
(PsyInteger oShift) psyClearBit
(PsyInteger oBit) psyCmp
(PsyRealNumeric oNumeric) Compares this object against given object and returns aninteger
indicating the result of the comparison.psyDiv
(PsyRealNumeric oNumeric) psyFlipBit
(PsyInteger oBit) psyIdiv
(PsyIntegral oInteger) psyInUnicodeBlock
(PsyTextual oTextual) Returns aboolean
indicating whether this object represents a zero value.psyMod
(PsyIntegral oIntegral) psyMul
(PsyRealNumeric oNumeric) psyNeg()
Returns anadditive
representing the result of arithmetic negation of this object.psyNot()
Returns a result of logical negation of this object.psyOr
(PsyIntegral oIntegral) Returns a result of logical disjunction of this object and given object.psySetBit
(PsyInteger oBit) Returns the signum of this object.psySub
(PsyRealNumeric oNumeric) psyTestBit
(PsyInteger oBit) psyXor
(PsyIntegral oIntegral) Returns a result of logical exclusive disjunction of this object and given object.Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface coneforest.psylla.core.PsyAdditive
psyNotZero
Methods inherited from interface coneforest.psylla.core.PsyIntegral
psyCeiling, psyDenominator, psyFloor, psyGCD, psyLCM, psyNumerator, psyRound, psyToIntegral
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
Methods inherited from interface coneforest.psylla.core.PsyRealNumeric
imagValue, psyAcos, psyAdd, psyAsin, psyAtan, psyCbrt, psyCos, psyCosh, psyDiv, psyExp, psyGe, psyGt, psyHypot, psyLe, psyLog, psyLt, psyMul, psyPow, psyPow, psySin, psySinh, psySqrt, psySub, psyTan, psyTanh, psyToInteger, psyToReal, realValue
-
Field Details
-
ZERO
Aninteger
representing the number 0. -
ONE
Aninteger
representing the number 1. -
TWO
Aninteger
representing the number 2. -
MINUS_ONE
Aninteger
representing the number −1. -
MAX_VALUE
Aninteger
representing the maximum representable value. -
MIN_VALUE
Aninteger
representing the minimum representable value.
-
-
Constructor Details
-
PsyInteger
public PsyInteger(long value)
-
-
Method Details
-
psyIsZero
Description copied from interface:PsyAdditive
Returns aboolean
indicating whether this object represents a zero value.- Specified by:
psyIsZero
in interfacePsyAdditive<PsyNumeric>
- Returns:
PsyBoolean.TRUE
if this object represents a zero value, andPsyBoolean.FALSE
otherwise.
-
intValue
public int intValue()- Specified by:
intValue
in interfacePsyRealNumeric
-
longValue
public long longValue()- Specified by:
longValue
in interfacePsyRealNumeric
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in interfacePsyRealNumeric
-
bigIntegerValue
- Specified by:
bigIntegerValue
in interfacePsyRational
-
toSyntaxString
- Specified by:
toSyntaxString
in interfacePsyObject
-
psyNot
Description copied from interface:PsyLogical
Returns a result of logical negation of this object.- Specified by:
psyNot
in interfacePsyLogical<PsyIntegral>
- Returns:
- a result.
-
psyOr
Description copied from interface:PsyLogical
Returns a result of logical disjunction of this object and given object.- Specified by:
psyOr
in interfacePsyLogical<PsyIntegral>
- Parameters:
oIntegral
- given object.- Returns:
- a result.
-
psyAnd
Description copied from interface:PsyLogical
Returns a result of logical conjunction of this object and given object.- Specified by:
psyAnd
in interfacePsyLogical<PsyIntegral>
- Parameters:
oIntegral
- given object.- Returns:
- a result.
-
psyXor
Description copied from interface:PsyLogical
Returns a result of logical exclusive disjunction of this object and given object.- Specified by:
psyXor
in interfacePsyLogical<PsyIntegral>
- Parameters:
oIntegral
- given object.- Returns:
- a result.
-
psyNeg
Description copied from interface:PsyAdditive
Returns anadditive
representing the result of arithmetic negation of this object.- Specified by:
psyNeg
in interfacePsyAdditive<PsyNumeric>
- Specified by:
psyNeg
in interfacePsyIntegral
- Specified by:
psyNeg
in interfacePsyRealNumeric
- Returns:
- a negation.
-
psyCmp
Description copied from interface:PsyScalar
Compares this object against given object and returns aninteger
indicating the result of the comparison. Returns negative value if this object is less than given one, zero if this object is equal to given one, and positive value if this object is greater than given one.- Specified by:
psyCmp
in interfacePsyScalar<PsyRealNumeric>
- Parameters:
oNumeric
- an object with which this object is compared.- Returns:
- a result of the comparison.
-
psyAbs
Description copied from interface:PsyNumeric
Returns anumeric
absolute value of this object.- Specified by:
psyAbs
in interfacePsyIntegral
- Specified by:
psyAbs
in interfacePsyNumeric
- Specified by:
psyAbs
in interfacePsyRealNumeric
- Returns:
- a
numeric
absolute value.
-
psyTestBit
- Specified by:
psyTestBit
in interfacePsyBitwise<PsyIntegral>
- Throws:
PsyErrorException
-
psyClearBit
- Specified by:
psyClearBit
in interfacePsyBitwise<PsyIntegral>
- Throws:
PsyErrorException
-
psySetBit
- Specified by:
psySetBit
in interfacePsyBitwise<PsyIntegral>
- Throws:
PsyErrorException
-
psyFlipBit
- Specified by:
psyFlipBit
in interfacePsyBitwise<PsyIntegral>
- Throws:
PsyErrorException
-
psySignum
Description copied from interface:PsyRealNumeric
Returns the signum of this object.- Specified by:
psySignum
in interfacePsyRealNumeric
- Returns:
- the
realnumeric
signum of this object.
-
psyAdd
- Specified by:
psyAdd
in interfacePsyRealNumeric
-
psySub
- Specified by:
psySub
in interfacePsyRealNumeric
-
psyMul
- Specified by:
psyMul
in interfacePsyRealNumeric
-
psyDiv
- Specified by:
psyDiv
in interfacePsyRealNumeric
- Throws:
PsyUndefinedResultException
-
psyMod
public PsyIntegral psyMod(PsyIntegral oIntegral) throws PsyUndefinedResultException, PsyRangeCheckException - Specified by:
psyMod
in interfacePsyIntegral
- Throws:
PsyUndefinedResultException
PsyRangeCheckException
-
psyIdiv
- Specified by:
psyIdiv
in interfacePsyIntegral
- Throws:
PsyUndefinedResultException
-
psyBitShift
- Specified by:
psyBitShift
in interfacePsyBitwise<PsyIntegral>
-
psyInUnicodeBlock
-
psyEq
- Specified by:
psyEq
in interfacePsyObject
- Specified by:
psyEq
in interfacePsyRealNumeric
-
hashCode
public int hashCode() -
equals
-
of
-