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,PsyIntegral,PsyLogical<PsyInteger>,PsyNumeric,PsyObject,PsyRealNumeric,PsyScalar<PsyRealNumeric>
public class PsyInteger extends Object implements PsyBitwise<PsyInteger>, PsyIntegral
A representation of Ψ-integerobject.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyIntegerMAX_VALUEA Ψ-integerrepresenting the maximum representable value.static PsyIntegerMIN_VALUEA Ψ-integerrepresenting the minimum representable value.static PsyIntegerMINUS_ONEA Ψ-integerrepresenting the number −1.static PsyIntegerONEA Ψ-integerrepresenting the number 1.static PsyIntegerTWOA Ψ-integerrepresenting the number 2.static PsyIntegerZEROA Ψ-integerrepresenting the number 0.-
Fields inherited from interface coneforest.psylla.core.PsyBitwise
OPERATORS
-
Fields inherited from interface coneforest.psylla.core.PsyIntegral
OPERATORS
-
-
Constructor Summary
Constructors Constructor Description PsyInteger(long value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BigIntegerbigIntegerValue()doubledoubleValue()booleanequals(Object object)inthashCode()intintValue()longlongValue()PsyRealNumericpsyAbs()Returns a Ψ-numericabsolute value of this object.PsyRealNumericpsyAdd(PsyRealNumeric oNumeric)PsyIntegerpsyAnd(PsyInteger oInteger)Returns a result of logical conjunction of this object and given object.PsyIntegerpsyBitShift(PsyInteger oShift)PsyIntegerpsyCeiling()PsyIntegerpsyClearBit(PsyInteger oBit)PsyIntegerpsyCmp(PsyRealNumeric oNumeric)Compares this object against given object and returns a Ψ-integerindicating the result of the comparison.PsyBooleanpsyEq(PsyObject o)PsyIntegerpsyFlipBit(PsyInteger oBit)PsyIntegerpsyFloor()PsyIntegerpsyIdiv(PsyIntegral oInteger)PsyBooleanpsyInUnicodeBlock(PsyTextual oTextual)PsyBooleanpsyIsZero()Returns a Ψ-booleanindicating whether this object represents a zero value.PsyIntegerpsyMod(PsyIntegral oInteger)PsyRealNumericpsyMul(PsyRealNumeric oNumeric)PsyRealNumericpsyNeg()Returns a Ψ-additiverepresenting the result of arithmetic negation of this object.PsyIntegerpsyNot()Returns a result of logical negation of this object.PsyIntegerpsyOr(PsyInteger oInteger)Returns a result of logical disjunction of this object and given object.PsyIntegerpsyRound()PsyIntegerpsySetBit(PsyInteger oBit)PsyIntegerpsySignum()Returns the signum of this object.PsyRealNumericpsySub(PsyRealNumeric oNumeric)PsyBooleanpsyTestBit(PsyInteger oBit)PsyIntegerpsyXor(PsyInteger oInteger)Returns a result of logical exclusive disjunction of this object and given object.StringtoSyntaxString()static PsyIntegervalueOf(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 Ψ-integerrepresenting the number 0.
-
ONE
public static final PsyInteger ONE
A Ψ-integerrepresenting the number 1.
-
TWO
public static final PsyInteger TWO
A Ψ-integerrepresenting the number 2.
-
MINUS_ONE
public static final PsyInteger MINUS_ONE
A Ψ-integerrepresenting the number −1.
-
MAX_VALUE
public static final PsyInteger MAX_VALUE
A Ψ-integerrepresenting the maximum representable value.
-
MIN_VALUE
public static final PsyInteger MIN_VALUE
A Ψ-integerrepresenting the minimum representable value.
-
-
Method Detail
-
psyIsZero
public PsyBoolean psyIsZero()
Description copied from interface:PsyArithmeticReturns a Ψ-booleanindicating whether this object represents a zero value.- Specified by:
psyIsZeroin interfacePsyArithmetic<PsyNumeric>- Returns:
PsyBoolean.TRUEif this object represents a zero value, andPsyBoolean.FALSEotherwise.
-
intValue
public int intValue()
- Specified by:
intValuein interfacePsyRealNumeric
-
longValue
public long longValue()
- Specified by:
longValuein interfacePsyRealNumeric
-
doubleValue
public double doubleValue()
- Specified by:
doubleValuein interfacePsyRealNumeric
-
bigIntegerValue
public BigInteger bigIntegerValue()
- Specified by:
bigIntegerValuein interfacePsyIntegral
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxStringin interfacePsyObject
-
psyNot
public PsyInteger psyNot()
Description copied from interface:PsyLogicalReturns a result of logical negation of this object.- Specified by:
psyNotin interfacePsyLogical<PsyInteger>- Returns:
- a result.
-
psyOr
public PsyInteger psyOr(PsyInteger oInteger)
Description copied from interface:PsyLogicalReturns a result of logical disjunction of this object and given object.- Specified by:
psyOrin interfacePsyLogical<PsyInteger>- Parameters:
oInteger- given object.- Returns:
- a result.
-
psyAnd
public PsyInteger psyAnd(PsyInteger oInteger)
Description copied from interface:PsyLogicalReturns a result of logical conjunction of this object and given object.- Specified by:
psyAndin interfacePsyLogical<PsyInteger>- Parameters:
oInteger- given object.- Returns:
- a result.
-
psyXor
public PsyInteger psyXor(PsyInteger oInteger)
Description copied from interface:PsyLogicalReturns a result of logical exclusive disjunction of this object and given object.- Specified by:
psyXorin interfacePsyLogical<PsyInteger>- Parameters:
oInteger- given object.- Returns:
- a result.
-
psyNeg
public PsyRealNumeric psyNeg()
Description copied from interface:PsyAdditiveReturns a Ψ-additiverepresenting the result of arithmetic negation of this object.- Specified by:
psyNegin interfacePsyAdditive<PsyNumeric>- Specified by:
psyNegin interfacePsyRealNumeric- Returns:
- a negation.
-
psyCmp
public PsyInteger psyCmp(PsyRealNumeric oNumeric)
Description copied from interface:PsyScalarCompares this object against given object and returns a Ψ-integerindicating 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:
psyCmpin 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:PsyNumericReturns a Ψ-numericabsolute value of this object.- Specified by:
psyAbsin interfacePsyNumeric- Specified by:
psyAbsin interfacePsyRealNumeric- Returns:
- a Ψ-
numericabsolute value.
-
psyTestBit
public PsyBoolean psyTestBit(PsyInteger oBit) throws PsyException
- Specified by:
psyTestBitin interfacePsyBitwise<PsyInteger>- Throws:
PsyException
-
psyClearBit
public PsyInteger psyClearBit(PsyInteger oBit) throws PsyException
- Specified by:
psyClearBitin interfacePsyBitwise<PsyInteger>- Throws:
PsyException
-
psySetBit
public PsyInteger psySetBit(PsyInteger oBit) throws PsyException
- Specified by:
psySetBitin interfacePsyBitwise<PsyInteger>- Throws:
PsyException
-
psyFlipBit
public PsyInteger psyFlipBit(PsyInteger oBit) throws PsyException
- Specified by:
psyFlipBitin interfacePsyBitwise<PsyInteger>- Throws:
PsyException
-
psySignum
public PsyInteger psySignum()
Description copied from interface:PsyRealNumericReturns the signum of this object.- Specified by:
psySignumin interfacePsyRealNumeric- Returns:
- the Ψ-
realnumericsignum of this object.
-
psyAdd
public PsyRealNumeric psyAdd(PsyRealNumeric oNumeric)
- Specified by:
psyAddin interfacePsyRealNumeric
-
psySub
public PsyRealNumeric psySub(PsyRealNumeric oNumeric)
- Specified by:
psySubin interfacePsyRealNumeric
-
psyMul
public PsyRealNumeric psyMul(PsyRealNumeric oNumeric)
- Specified by:
psyMulin interfacePsyRealNumeric
-
psyFloor
public PsyInteger psyFloor()
- Specified by:
psyFloorin interfacePsyRealNumeric
-
psyRound
public PsyInteger psyRound()
- Specified by:
psyRoundin interfacePsyRealNumeric
-
psyCeiling
public PsyInteger psyCeiling()
- Specified by:
psyCeilingin interfacePsyRealNumeric
-
psyMod
public PsyInteger psyMod(PsyIntegral oInteger) throws PsyException
- Specified by:
psyModin interfacePsyIntegral- Throws:
PsyException
-
psyIdiv
public PsyInteger psyIdiv(PsyIntegral oInteger) throws PsyException
- Specified by:
psyIdivin interfacePsyIntegral- Throws:
PsyException
-
psyBitShift
public PsyInteger psyBitShift(PsyInteger oShift)
- Specified by:
psyBitShiftin interfacePsyBitwise<PsyInteger>
-
psyInUnicodeBlock
public PsyBoolean psyInUnicodeBlock(PsyTextual oTextual)
-
psyEq
public PsyBoolean psyEq(PsyObject o)
- Specified by:
psyEqin interfacePsyObject- Specified by:
psyEqin interfacePsyRealNumeric
-
valueOf
public static PsyInteger valueOf(long integer)
-
-