Package iterables

Source Code of iterables.MyTableOfStringsReverseIteration

package iterables;
import iterators.MyTableOfStringsReverseIterator;

import java.lang.Iterable;
import java.util.Iterator;


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

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

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

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

}
TOP

Related Classes of iterables.MyTableOfStringsReverseIteration

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.