Package iterables

Source Code of iterables.MyTableOfStringsRandomIteration

package iterables;

import iterators.MyTableOfStringsRandomIterator;

import java.util.Iterator;


/**
*
* @author luongnv89
* @version 1
*
* Wraps an array of String data in an {@link Iterable} class, where
*  we iterate through the elements in random order<br>
*
*/
public class MyTableOfStringsRandomIteration implements Iterable<String> {
 
 
public String[] data;

public MyTableOfStringsRandomIteration(String [] data) {
this.data = data;
}

public int length(){return data.length;}

public Iterator<String> iterator() {
return new MyTableOfStringsRandomIterator(this);
}

}
TOP

Related Classes of iterables.MyTableOfStringsRandomIteration

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.