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> {
- private List<String> lista;
- private 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(lista);
- }else {
- return new Rebote(lista);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement