Package edu.jas.arith
Class BigRationalIterator
java.lang.Object
edu.jas.arith.BigRationalIterator
- All Implemented Interfaces:
Iterator<BigRational>
Big rational iterator. Uses Cantors diagonal enumeration.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) BigRational
data structure.(package private) BigInteger
(package private) Iterator
<BigInteger> (package private) List
<BigInteger> (package private) Iterator
<BigInteger> protected long
(package private) final boolean
(package private) BigInteger
(package private) Iterator
<BigInteger> (package private) List
<BigInteger> (package private) Iterator
<BigInteger> -
Constructor Summary
ConstructorsConstructorDescriptionBigRational iterator constructor.BigRationalIterator
(boolean nn) BigRational iterator constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
curr
BigRational currdata structure. -
den
BigInteger den -
num
BigInteger num -
denit
Iterator<BigInteger> denit -
numit
Iterator<BigInteger> numit -
denlist
List<BigInteger> denlist -
numlist
List<BigInteger> numlist -
denlistit
Iterator<BigInteger> denlistit -
numlistit
Iterator<BigInteger> numlistit -
nonNegative
final boolean nonNegative -
level
protected long level
-
-
Constructor Details
-
BigRationalIterator
public BigRationalIterator()BigRational iterator constructor. -
BigRationalIterator
public BigRationalIterator(boolean nn) BigRational iterator constructor.- Parameters:
nn
- indicator for a non-negative iterator, if true, false for an all iterator
-
-
Method Details
-
hasNext
public boolean hasNext()Test for availability of a next element.- Specified by:
hasNext
in interfaceIterator<BigRational>
- Returns:
- true if the iteration has more elements, else false.
-
next
Get next rational.- Specified by:
next
in interfaceIterator<BigRational>
- Returns:
- next rational.
-
remove
public void remove()Remove an element if allowed.- Specified by:
remove
in interfaceIterator<BigRational>
-