Package tests

Source Code of tests.MyTableOfStringsIteration_Test

package tests;

import iterables.MyTableOfStringsRandomIteration;
import iterables.MyTableOfStringsReverseIteration;

/**
*
* @author J Paul Gibson
* @version 1
*
*          A simple test for the {@link MyTableOfStringsReverseIteration}<br>
* <br>
*
*          TYPICAL EXPECTED OUTPUT : <br>
*
*          <pre>
* Iterate over original data array
*  one
*  two
*  three
*  four
*  one
*
* Iterate over same data in MyTableOfStringsReverseIteration
*  one
*  four
*  three
*  two
*  one
* </pre>
**/
public class MyTableOfStringsIteration_Test {

  public static void main(String[] s) {

    String[] data = { "one", "two", "three", "four", "one" };
    MyTableOfStringsReverseIteration t1 = new MyTableOfStringsReverseIteration(
        data);
    MyTableOfStringsRandomIteration t2 = new MyTableOfStringsRandomIteration(
        data);

    System.out.println("Iterate over original data array");
    for (String value : data) {
      System.out.println(" " + value);
    }
    System.out
        .println("\nIterate over same data in MyTableOfStringsReverseIteration");
    for (String value : t1) {
      System.out.println(" " + value);
    }

    System.out
        .println("\nIterate over same data in MyTableOfStringsRandomIteration");
    for (String value : t2) {
      System.out.println(" " + value);
    }

  }
}
TOP

Related Classes of tests.MyTableOfStringsIteration_Test

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.