Package edu.jas.arith
Class BigRationalIterator
- java.lang.Object
-
- edu.jas.arith.BigRationalIterator
-
- All Implemented Interfaces:
java.util.Iterator<BigRational>
class BigRationalIterator extends java.lang.Object implements java.util.Iterator<BigRational>
Big rational iterator. Uses Cantors diagonal enumeration.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) BigRational
curr
data structure.(package private) BigInteger
den
(package private) java.util.Iterator<BigInteger>
denit
(package private) java.util.List<BigInteger>
denlist
(package private) java.util.Iterator<BigInteger>
denlistit
protected long
level
(package private) boolean
nonNegative
(package private) BigInteger
num
(package private) java.util.Iterator<BigInteger>
numit
(package private) java.util.List<BigInteger>
numlist
(package private) java.util.Iterator<BigInteger>
numlistit
-
Constructor Summary
Constructors Constructor Description BigRationalIterator()
BigRational iterator constructor.BigRationalIterator(boolean nn)
BigRational iterator constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
Test for availability of a next element.BigRational
next()
Get next rational.void
remove()
Remove an element if allowed.
-
-
-
Field Detail
-
curr
BigRational curr
data structure.
-
den
BigInteger den
-
num
BigInteger num
-
denit
java.util.Iterator<BigInteger> denit
-
numit
java.util.Iterator<BigInteger> numit
-
denlist
java.util.List<BigInteger> denlist
-
numlist
java.util.List<BigInteger> numlist
-
denlistit
java.util.Iterator<BigInteger> denlistit
-
numlistit
java.util.Iterator<BigInteger> numlistit
-
nonNegative
final boolean nonNegative
-
level
protected long level
-
-
Method Detail
-
hasNext
public boolean hasNext()
Test for availability of a next element.- Specified by:
hasNext
in interfacejava.util.Iterator<BigRational>
- Returns:
- true if the iteration has more elements, else false.
-
next
public BigRational next()
Get next rational.- Specified by:
next
in interfacejava.util.Iterator<BigRational>
- Returns:
- next rational.
-
remove
public void remove()
Remove an element if allowed.- Specified by:
remove
in interfacejava.util.Iterator<BigRational>
-
-