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