Package coneforest.psylla.core
Class PsyInteger
- java.lang.Object
-
- coneforest.psylla.core.PsyInteger
-
- All Implemented Interfaces:
PsyAdditive<PsyNumeric>
,PsyArithmetic<PsyNumeric>
,PsyAtomic
,PsyBitwise<PsyInteger>
,PsyConvertableToInteger
,PsyConvertableToName
,PsyConvertableToReal
,PsyConvertableToString
,PsyLogical<PsyInteger>
,PsyNumeric
,PsyObject
,PsyRealNumeric
,PsyScalar<PsyRealNumeric>
public class PsyInteger extends Object implements PsyBitwise<PsyInteger>, PsyRealNumeric
A representation of Ψ-integer
object.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyInteger
MAX_VALUE
A Ψ-integer
representing the maximum representable value.static PsyInteger
MIN_VALUE
A Ψ-integer
representing the minimum representable value.static PsyInteger
MINUS_ONE
A Ψ-integer
representing the number −1.static PsyInteger
ONE
A Ψ-integer
representing the number 1.static PsyInteger
TWO
A Ψ-integer
representing the number 2.static PsyInteger
ZERO
A Ψ-integer
representing the number 0.
-
Constructor Summary
Constructors Constructor Description PsyInteger(long value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
doubleValue()
boolean
equals(Object object)
int
hashCode()
int
intValue()
long
longValue()
PsyRealNumeric
psyAbs()
Returns a Ψ-numeric
absolute value of this object.PsyRealNumeric
psyAdd(PsyRealNumeric oNumeric)
PsyInteger
psyAnd(PsyInteger oInteger)
Returns a result of logical conjunction of this object and given object.PsyInteger
psyBitShift(PsyInteger oShift)
PsyInteger
psyCeiling()
PsyInteger
psyClearBit(PsyInteger oBit)
PsyInteger
psyCmp(PsyRealNumeric oNumeric)
Compares this object against given object and returns a Ψ-integer
indicating the result of the comparison.PsyBoolean
psyEq(PsyObject o)
PsyInteger
psyFlipBit(PsyInteger oBit)
PsyInteger
psyFloor()
PsyInteger
psyIdiv(PsyInteger oInteger)
PsyBoolean
psyInUnicodeBlock(PsyStringy oStringy)
PsyBoolean
psyIsZero()
Returns a Ψ-boolean
indicating whether this object represents a zero value.PsyInteger
psyMod(PsyInteger oInteger)
PsyRealNumeric
psyMul(PsyRealNumeric oNumeric)
PsyRealNumeric
psyNeg()
Returns a Ψ-additive
representing the result of arithmetic negation of this object.PsyInteger
psyNot()
Returns a result of logical negation of this object.PsyInteger
psyOr(PsyInteger oInteger)
Returns a result of logical disjunction of this object and given object.PsyInteger
psyRound()
PsyInteger
psySetBit(PsyInteger oBit)
PsyInteger
psySignum()
Returns the signum of this object.PsyRealNumeric
psySub(PsyRealNumeric oNumeric)
PsyBoolean
psyTestBit(PsyInteger oBit)
PsyInteger
psyXor(PsyInteger oInteger)
Returns a result of logical exclusive disjunction of this object and given object.String
toSyntaxString()
static PsyInteger
valueOf(long integer)
-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface coneforest.psylla.core.PsyArithmetic
psyNotZero
-
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, psyDiv, psyExp, psyGe, psyGt, psyHypot, psyLe, psyLog, psyLt, psyMul, psyPow, psyPow, psySin, psySinh, psySqrt, psySub, psyTan, psyTanh, psyToInteger, psyToReal, realValue
-
-
-
-
Field Detail
-
ZERO
public static final PsyInteger ZERO
A Ψ-integer
representing the number 0.
-
ONE
public static final PsyInteger ONE
A Ψ-integer
representing the number 1.
-
TWO
public static final PsyInteger TWO
A Ψ-integer
representing the number 2.
-
MINUS_ONE
public static final PsyInteger MINUS_ONE
A Ψ-integer
representing the number −1.
-
MAX_VALUE
public static final PsyInteger MAX_VALUE
A Ψ-integer
representing the maximum representable value.
-
MIN_VALUE
public static final PsyInteger MIN_VALUE
A Ψ-integer
representing the minimum representable value.
-
-
Method Detail
-
psyIsZero
public PsyBoolean psyIsZero()
Description copied from interface:PsyArithmetic
Returns a Ψ-boolean
indicating whether this object represents a zero value.- Specified by:
psyIsZero
in interfacePsyArithmetic<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
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxString
in interfacePsyObject
-
psyNot
public PsyInteger psyNot()
Description copied from interface:PsyLogical
Returns a result of logical negation of this object.- Specified by:
psyNot
in interfacePsyLogical<PsyInteger>
- Returns:
- a result.
-
psyOr
public PsyInteger psyOr(PsyInteger oInteger)
Description copied from interface:PsyLogical
Returns a result of logical disjunction of this object and given object.- Specified by:
psyOr
in interfacePsyLogical<PsyInteger>
- Parameters:
oInteger
- given object.- Returns:
- a result.
-
psyAnd
public PsyInteger psyAnd(PsyInteger oInteger)
Description copied from interface:PsyLogical
Returns a result of logical conjunction of this object and given object.- Specified by:
psyAnd
in interfacePsyLogical<PsyInteger>
- Parameters:
oInteger
- given object.- Returns:
- a result.
-
psyXor
public PsyInteger psyXor(PsyInteger oInteger)
Description copied from interface:PsyLogical
Returns a result of logical exclusive disjunction of this object and given object.- Specified by:
psyXor
in interfacePsyLogical<PsyInteger>
- Parameters:
oInteger
- given object.- Returns:
- a result.
-
psyNeg
public PsyRealNumeric psyNeg()
Description copied from interface:PsyAdditive
Returns a Ψ-additive
representing the result of arithmetic negation of this object.- Specified by:
psyNeg
in interfacePsyAdditive<PsyNumeric>
- Specified by:
psyNeg
in interfacePsyRealNumeric
- Returns:
- a negation.
-
psyCmp
public PsyInteger psyCmp(PsyRealNumeric oNumeric)
Description copied from interface:PsyScalar
Compares this object against given object and returns a Ψ-integer
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
public PsyRealNumeric psyAbs()
Description copied from interface:PsyNumeric
Returns a Ψ-numeric
absolute value of this object.- Specified by:
psyAbs
in interfacePsyNumeric
- Specified by:
psyAbs
in interfacePsyRealNumeric
- Returns:
- a Ψ-
numeric
absolute value.
-
psyTestBit
public PsyBoolean psyTestBit(PsyInteger oBit) throws PsyException
- Specified by:
psyTestBit
in interfacePsyBitwise<PsyInteger>
- Throws:
PsyException
-
psyClearBit
public PsyInteger psyClearBit(PsyInteger oBit) throws PsyException
- Specified by:
psyClearBit
in interfacePsyBitwise<PsyInteger>
- Throws:
PsyException
-
psySetBit
public PsyInteger psySetBit(PsyInteger oBit) throws PsyException
- Specified by:
psySetBit
in interfacePsyBitwise<PsyInteger>
- Throws:
PsyException
-
psyFlipBit
public PsyInteger psyFlipBit(PsyInteger oBit) throws PsyException
- Specified by:
psyFlipBit
in interfacePsyBitwise<PsyInteger>
- Throws:
PsyException
-
psySignum
public PsyInteger 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
public PsyRealNumeric psyAdd(PsyRealNumeric oNumeric)
- Specified by:
psyAdd
in interfacePsyRealNumeric
-
psySub
public PsyRealNumeric psySub(PsyRealNumeric oNumeric)
- Specified by:
psySub
in interfacePsyRealNumeric
-
psyMul
public PsyRealNumeric psyMul(PsyRealNumeric oNumeric)
- Specified by:
psyMul
in interfacePsyRealNumeric
-
psyFloor
public PsyInteger psyFloor()
- Specified by:
psyFloor
in interfacePsyRealNumeric
-
psyRound
public PsyInteger psyRound()
- Specified by:
psyRound
in interfacePsyRealNumeric
-
psyCeiling
public PsyInteger psyCeiling()
- Specified by:
psyCeiling
in interfacePsyRealNumeric
-
psyMod
public PsyInteger psyMod(PsyInteger oInteger) throws PsyException
- Throws:
PsyException
-
psyIdiv
public PsyInteger psyIdiv(PsyInteger oInteger) throws PsyException
- Throws:
PsyException
-
psyBitShift
public PsyInteger psyBitShift(PsyInteger oShift)
- Specified by:
psyBitShift
in interfacePsyBitwise<PsyInteger>
-
psyInUnicodeBlock
public PsyBoolean psyInUnicodeBlock(PsyStringy oStringy)
-
psyEq
public PsyBoolean psyEq(PsyObject o)
- Specified by:
psyEq
in interfacePsyObject
- Specified by:
psyEq
in interfacePsyRealNumeric
-
valueOf
public static PsyInteger valueOf(long integer)
-
-