java.lang.Object
org.kink_lang.kink.internal.num.NumOperations
Number operations used in Kink.
-
Method Summary
Modifier and TypeMethodDescriptionstatic intgetElemIndex(Val val, int size) Returns the exact int value of the val, if the val is a NumVal and it represents a valid element index exactly in the sequence which has the sizesize, otherwise returns -1.static intgetPosIndex(Val val, int size) Returns the exact int value of the val, if the val is a NumVal and it represents a valid position index exactly in the sequence which has the sizesize, otherwise returns -1.static booleanisRangePair(NumVal from, NumVal to, int size) Returns whetherfromandtoare proper range indexes of the sequence which has the sizesize.
-
Method Details
-
getElemIndex
Returns the exact int value of the val, if the val is a NumVal and it represents a valid element index exactly in the sequence which has the sizesize, otherwise returns -1.- Parameters:
val- the val from which the index is extracted.size- the size of a sequence.- Returns:
- the exact int number of the val, or -1.
-
getPosIndex
Returns the exact int value of the val, if the val is a NumVal and it represents a valid position index exactly in the sequence which has the sizesize, otherwise returns -1.- Parameters:
val- the val from which the index is extracted.size- the size of a sequence.- Returns:
- the exact int number of the val, or -1.
-
isRangePair
Returns whetherfromandtoare proper range indexes of the sequence which has the sizesize.- Parameters:
from- the from index.to- the to index.size- the size of a sequence.- Returns:
- true if
fromandtoare proper range indexes.
-