- All Superinterfaces:
CardinalNumber,Comparable<RealNumber>,CountableNumber,Integer,NaturalNumber,Number,RationalNumber,RealNumber
- All Known Subinterfaces:
AtLeastEight,AtLeastEighteen,AtLeastEleven,AtLeastFifteen,AtLeastFive,AtLeastFour,AtLeastFourteen,AtLeastNine,AtLeastNineteen,AtLeastOne,AtLeastSeven,AtLeastSeventeen,AtLeastSix,AtLeastSixteen,AtLeastTen,AtLeastThirteen,AtLeastThree,AtLeastTwelve,AtLeastTwenty,AtLeastTwo,FourOrEight
- All Known Implementing Classes:
Eight,Eighteen,Eleven,Fifteen,Five,Four,Fourteen,Nine,Nineteen,One,Seven,Seventeen,Six,Sixteen,Ten,Thirteen,Three,Twelve,Twenty,Two
A
PositiveInteger is a NaturalNumber
that isn't Zero.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault Stream<PositiveInteger>Returns aStreamof allPositiveIntegers in the range fromOneto thisPositiveIntegerdefault Stream<PositiveInteger>Returns aStreamof allPositiveIntegers in the range fromOneto thisPositiveIntegerminus 1default Stream<NaturalNumber>Returns aStreamof allNaturalNumbers in the range from thisNaturalNumberminus 1 toZerodefault Stream<PositiveInteger>Returns aStreamof allPositiveIntegers in the range from thisPositiveIntegerto the givenPositiveIntegerdefault PositiveIntegerReturns the quotient of dividing thisPositiveIntegerby the givenPositiveIntegerdefault NaturalNumberminusOne()Returns theNaturalNumberthat is one less than thisPositiveIntegerstatic PositiveIntegerof(int i) Creates a newPositiveIntegerwhose value is the givenintstatic PositiveIntegerof(long l) Creates a newPositiveIntegerwhose value is the givenlongstatic PositiveIntegerof(BigInteger bi) Creates a newPositiveIntegerwhose value is the givenBigIntegerstatic PositiveIntegerCreates a newPositiveIntegerfrom the given string or throws anExceptionif the string does not represent aPositiveInteger.default PositiveIntegerReturns the sum of thisPositiveIntegerand the givenPositiveIntegerdefault PositiveIntegerReturns the product of thisPositiveIntegerand the givenPositiveIntegerMethods inherited from interface org.zfcj.math.numbers.Integer
bigIntegerValue, compareTo, countTo, denominator, divide, doubleValue, greaterThan, greaterThanOrEqualTo, intDenominator, intNumerator, intValue, lessThan, lessThanOrEqualTo, longDenominator, longNumerator, longValue, minus, modulo, numerator, plus, timesMethods inherited from interface org.zfcj.math.numbers.NaturalNumber
count0ToN, count0ToNMinus1, countNTo0, countNTo1, countTo, divide, modulo, plus, timesMethods inherited from interface org.zfcj.math.numbers.RationalNumber
dividedBy, isInt, isLong, minus, plus, reduce, timesMethods inherited from interface org.zfcj.math.numbers.RealNumber
abs, almostEquals, almostEquals, bigDecimalValue, dividedBy, greaterThan, greaterThanOrEqualTo, isDouble, lessThan, lessThanOrEqualTo, minus, modulo, plus, pow, times, truncate
-
Field Details
-
MAX_INT
-
-
Method Details
-
plus
Returns the sum of thisPositiveIntegerand the givenPositiveInteger- Specified by:
plusin interfaceNaturalNumber- Parameters:
n- the positive integer to sum- Returns:
- the sum of positive integers
-
minusOne
Returns theNaturalNumberthat is one less than thisPositiveInteger- Returns:
- this positive integer minus 1
-
times
Returns the product of thisPositiveIntegerand the givenPositiveInteger- Parameters:
n- the positive integer to multiply- Returns:
- the product of positive integers
-
divide
Returns the quotient of dividing thisPositiveIntegerby the givenPositiveInteger- Parameters:
n- the positive integer to divide by- Returns:
- the quotient of positive integers
-
count1ToN
Returns aStreamof allPositiveIntegers in the range fromOneto thisPositiveInteger- Returns:
- a stream of
PositiveIntegers
-
count1ToNMinus1
Returns aStreamof allPositiveIntegers in the range fromOneto thisPositiveIntegerminus 1- Returns:
- a stream of
PositiveIntegers
-
countNMinus1To0
Returns aStreamof allNaturalNumbers in the range from thisNaturalNumberminus 1 toZero- Returns:
- a stream of
NaturalNumbers
-
countTo
Returns aStreamof allPositiveIntegers in the range from thisPositiveIntegerto the givenPositiveInteger- Parameters:
i- the positive integer to count o- Returns:
- a stream of
PositiveIntegers
-
of
Creates a newPositiveIntegerwhose value is the givenint- Parameters:
i- the int value- Returns:
- a
PositiveIntegerwith the given value - Throws:
IllegalArgumentException- if i less than 1
-
of
Creates a newPositiveIntegerwhose value is the givenlong- Parameters:
l- the int value- Returns:
- a
PositiveIntegerwith the given value - Throws:
IllegalArgumentException- if l less than 1
-
of
Creates a newPositiveIntegerwhose value is the givenBigInteger- Parameters:
bi- the big integer value- Returns:
- a
PositiveIntegerwith the given value - Throws:
IllegalArgumentException- if bi less than 1
-
parse
Creates a newPositiveIntegerfrom the given string or throws anExceptionif the string does not represent aPositiveInteger.- Parameters:
s- the "positive integer" string- Returns:
- a
PositiveInteger
-