Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package e2;
- import java.util.ArrayList;
- import java.util.Iterator;
- import java.util.List;
- import java.util.concurrent.ThreadLocalRandom;
- public class TVRealityList<String> implements Iterable<String> {
- List<String> lista = new ArrayList<String>();
- boolean circular;
- public TVRealityList(List<String> lista, boolean circular) {
- this.lista=lista;
- this.circular=circular;
- }
- @Override
- public Iterator<String> iterator(){
- if(circular){
- return new Circular<String>(lista);
- }else {
- return new Rebote<String>(lista);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement