Package coneforest.psylla.core
Class PsyBoolean
- java.lang.Object
-
- coneforest.psylla.core.PsyBoolean
-
- All Implemented Interfaces:
PsyAtomic
,PsyConvertableToName
,PsyConvertableToString
,PsyLogical<PsyBoolean>
,PsyObject
,PsyScalar<PsyBoolean>
public class PsyBoolean extends Object implements PsyAtomic, PsyScalar<PsyBoolean>, PsyLogical<PsyBoolean>
A representation of Ψ-boolean
object.
-
-
Field Summary
Fields Modifier and Type Field Description static PsyBoolean
FALSE
A Ψ-boolean
constant, representing false.static PsyBoolean
TRUE
A Ψ-boolean
constant, representing true.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
booleanValue()
Returns a boolean value of this object.boolean
equals(Object object)
int
hashCode()
PsyBoolean
psyAnd(PsyBoolean oBoolean)
Returns a result of boolean conjunction of this object and given object.PsyInteger
psyCmp(PsyBoolean oBoolean)
Compares this object against given object and returns a Ψ-integer
indicating the result of the comparison.PsyBoolean
psyEq(PsyObject o)
Returns a result of equality test of this object and given object.PsyBoolean
psyGe(PsyBoolean oBoolean)
Returns a Ψ-boolean
object representing the result of “greater or equal” comparison of this object and a given object.PsyBoolean
psyGt(PsyBoolean oBoolean)
Returns a Ψ-boolean
object representing the result of “greater” comparison of this object and a given object.PsyBoolean
psyLe(PsyBoolean oBoolean)
Returns a Ψ-boolean
object representing the result of “less or equal” comparison of this object and a given object.PsyBoolean
psyLt(PsyBoolean oBoolean)
Returns a Ψ-boolean
object representing the result of “less” comparison of this object and a given object.PsyBoolean
psyNot()
Returns a result of boolean negation of this object.PsyBoolean
psyOr(PsyBoolean oBoolean)
Returns a result of boolean disjunction of this object and given object.PsyBoolean
psyXor(PsyBoolean oBoolean)
Returns a result of boolean exclusive disjunction of this object and given object.String
toSyntaxString()
static PsyBoolean
valueOf(boolean bool)
Returns a Ψ-boolean
representing the given boolean value.-
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToName, psyToString, psyType, typeName
-
-
-
-
Field Detail
-
FALSE
public static final PsyBoolean FALSE
A Ψ-boolean
constant, representing false.
-
TRUE
public static final PsyBoolean TRUE
A Ψ-boolean
constant, representing true.
-
-
Method Detail
-
booleanValue
public boolean booleanValue()
Returns a boolean value of this object.- Returns:
- a boolean value of this object.
-
toSyntaxString
public String toSyntaxString()
- Specified by:
toSyntaxString
in interfacePsyObject
- Returns:
- a string
false
ortrue
depending on this object value.
-
psyNot
public PsyBoolean psyNot()
Returns a result of boolean negation of this object.- Specified by:
psyNot
in interfacePsyLogical<PsyBoolean>
- Returns:
- a result.
-
psyOr
public PsyBoolean psyOr(PsyBoolean oBoolean)
Returns a result of boolean disjunction of this object and given object.- Specified by:
psyOr
in interfacePsyLogical<PsyBoolean>
- Parameters:
oBoolean
- given object.- Returns:
- a result.
-
psyAnd
public PsyBoolean psyAnd(PsyBoolean oBoolean)
Returns a result of boolean conjunction of this object and given object.- Specified by:
psyAnd
in interfacePsyLogical<PsyBoolean>
- Parameters:
oBoolean
- given object.- Returns:
- a result.
-
psyXor
public PsyBoolean psyXor(PsyBoolean oBoolean)
Returns a result of boolean exclusive disjunction of this object and given object.- Specified by:
psyXor
in interfacePsyLogical<PsyBoolean>
- Parameters:
oBoolean
- given object.- Returns:
- a result.
-
psyEq
public PsyBoolean psyEq(PsyObject o)
Returns a result of equality test of this object and given object.
-
psyCmp
public PsyInteger psyCmp(PsyBoolean oBoolean)
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<PsyBoolean>
- Parameters:
oBoolean
- an object with which this object is compared.- Returns:
- a result of the comparison.
-
psyLt
public PsyBoolean psyLt(PsyBoolean oBoolean)
Description copied from interface:PsyScalar
Returns a Ψ-boolean
object representing the result of “less” comparison of this object and a given object.- Specified by:
psyLt
in interfacePsyScalar<PsyBoolean>
- Parameters:
oBoolean
- an object with which this object is compared.- Returns:
- a Ψ boolean value indicating if this object is less than given object.
-
psyLe
public PsyBoolean psyLe(PsyBoolean oBoolean)
Description copied from interface:PsyScalar
Returns a Ψ-boolean
object representing the result of “less or equal” comparison of this object and a given object.- Specified by:
psyLe
in interfacePsyScalar<PsyBoolean>
- Parameters:
oBoolean
- an object with which this object is compared.- Returns:
- a Ψ boolean value indicating if this object is less than or equal to given object.
-
psyGt
public PsyBoolean psyGt(PsyBoolean oBoolean)
Description copied from interface:PsyScalar
Returns a Ψ-boolean
object representing the result of “greater” comparison of this object and a given object.- Specified by:
psyGt
in interfacePsyScalar<PsyBoolean>
- Parameters:
oBoolean
- an object with which this object is compared.- Returns:
- a Ψ-
boolean
result of comparison.
-
psyGe
public PsyBoolean psyGe(PsyBoolean oBoolean)
Description copied from interface:PsyScalar
Returns a Ψ-boolean
object representing the result of “greater or equal” comparison of this object and a given object.- Specified by:
psyGe
in interfacePsyScalar<PsyBoolean>
- Parameters:
oBoolean
- an object with which this object is compared.- Returns:
- a Ψ-
boolean
result of comparison.
-
valueOf
public static PsyBoolean valueOf(boolean bool)
Returns a Ψ-boolean
representing the given boolean value.- Parameters:
bool
- a given value.- Returns:
- a Ψ-
boolean
object.
-
-