- Type Parameters:
T
- a type of the second operand at binary comparison operation.
- All Superinterfaces:
Comparable<T>
,PsyObject
- All Known Subinterfaces:
PsyIntegral
,PsyRational
,PsyRealNumeric
,PsyTextual
- All Known Implementing Classes:
PsyBigFraction
,PsyBigInteger
,PsyBoolean
,PsyFraction
,PsyInteger
,PsyName
,PsyReal
,PsyString
,PsyStringBuffer
The representation of
scalar
, a type bringing total ordering to implementing Psylla
type. This interface declares methods for comparison.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thecmp
operator.static final ContextAction
Context action of thege
operator.static final ContextAction
Context action of thegt
operator.static final ContextAction
Context action of thele
operator.static final ContextAction
Context action of thelt
operator.static final ContextAction
Context action of themax
operator.static final ContextAction
Context action of themin
operator.Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TOSTRING, PSY_TOSTRINGBUFFER, PSY_TYPE
-
Method Summary
Modifier and TypeMethodDescriptionint
Compares thisscalar
with the specifiedscalar
for order.default PsyInteger
Compares thisscalar
against givenscalar
and returns aninteger
indicating the result of the comparison.default PsyBoolean
Returns aboolean
object representing the result of “greater or equal” comparison of thisscalar
and a givenscalar
.default PsyBoolean
Returns aboolean
object representing the result of “greater” comparison of thisscalar
and a givenscalar
.default PsyBoolean
Returns aboolean
object representing the result of “less or equal” comparison of thisscalar
and a givenscalar
.default PsyBoolean
Returns aboolean
object representing the result of “less” comparison of thisscalar
and a givenscalar
.Returns the maximum of thisscalar
and givenscalar
.Returns the minimum of thisscalar
and givenscalar
.Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToString, psyToStringBuffer, psyType, toSyntaxString, typeName
-
Field Details
-
PSY_CMP
Context action of thecmp
operator. -
PSY_GE
Context action of thege
operator. -
PSY_GT
Context action of thegt
operator. -
PSY_LE
Context action of thele
operator. -
PSY_LT
Context action of thelt
operator. -
PSY_MAX
Context action of themax
operator. -
PSY_MIN
Context action of themin
operator.
-
-
Method Details
-
compareTo
Compares thisscalar
with the specifiedscalar
for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specifiedscalar
.- Specified by:
compareTo
in interfaceComparable<T extends PsyScalar<T>>
- Parameters:
oScalar
- thescalar
to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified.
-
psyLt
Returns aboolean
object representing the result of “less” comparison of thisscalar
and a givenscalar
.- Parameters:
oScalar
- an object with which this object is compared.- Returns:
- a
boolean
object representing the result of “less” comparison of thisscalar
and a givenscalar
-
psyLe
Returns aboolean
object representing the result of “less or equal” comparison of thisscalar
and a givenscalar
.- Parameters:
oScalar
- an object with which this object is compared.- Returns:
- a
boolean
object representing the result of “less or equal” comparison of thisscalar
and a givenscalar
-
psyGt
Returns aboolean
object representing the result of “greater” comparison of thisscalar
and a givenscalar
.- Parameters:
oScalar
- an object with which this object is compared.- Returns:
- a
boolean
object representing the result of “greater” comparison of thisscalar
and a givenscalar
-
psyGe
Returns aboolean
object representing the result of “greater or equal” comparison of thisscalar
and a givenscalar
.- Parameters:
oScalar
- an object with which this object is compared.- Returns:
- a
boolean
object representing the result of “greater or equal” comparison of thisscalar
and a givenscalar
-
psyCmp
Compares thisscalar
against givenscalar
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.- Parameters:
oScalar
- an object with which this object is compared.- Returns:
- a result of the comparison.
-
psyMin
Returns the minimum of thisscalar
and givenscalar
.- Parameters:
oScalar
- the givenscalar
.- Returns:
- the minimum of this
scalar
and givenscalar
-
psyMax
Returns the maximum of thisscalar
and givenscalar
.- Parameters:
oScalar
- the givenscalar
.- Returns:
- the maximum of this
scalar
and givenscalar
-