Code example for BigInteger

Methods: compareTo

0
	public Iterator<BigInteger> iterator() {
		return new Iterator<BigInteger>(){
			protected BigInteger current = lbound;
			@Override 
			public boolean hasNext() { 
				return current.compareTo(ubound) <= 0;
			} 
 
			@Override 
			public BigInteger next() {
				BigInteger result = current;
				current = current.add(step);
				return result;
			} 
 
			@Override 
			public void remove() { 
				throw new UnsupportedOperationException();
			} 
		}; 
	}