package org.academiadecodigo.bootcamp11.integerrange;

import java.util.Iterator;

/**
 * MIT License
 * (c) 2017 Ricardo Constantino
 */

public class Main {
    public static void main(String[] args) {


        IntegerRange settableInterval = new IntegerRange(20, 10, -3);
        Iterator<Integer> newIt = settableInterval.iterator();

        System.out.println("for 0 < 3");
        for (int i = 0; i < 3; i++) {
            System.out.println(newIt.next());
        }

        System.out.println("reverse");
        settableInterval.reverse();

        // this should continue with the same min/max/interval as before
        // i.e. go from 13 to 19
        System.out.println("while");
        while(newIt.hasNext()) {
            System.out.println(newIt.next());
        }

        System.out.println("new iterator() after reverse");
        for (int i : settableInterval) {
            System.out.println(i);
        }

        System.out.println("setDescending()");
        settableInterval.setDescending();
        for (int i : settableInterval) {
            System.out.println(i);
        }

        System.out.println("setAscending()");
        settableInterval.setAscending();
        for (int i : settableInterval) {
            System.out.println(i);
        }
    }
}
