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 abstract class TVRealityList implements Iterable<String>{
- private int pos;
- private List<String> lista = new ArrayList<String>();
- private int k= getRandomValue(lista.size());
- public abstract boolean hasNext();
- public abstract Object next();
- public abstract void remove();
- public static int getRandomValue(int size) {
- // Get and return the random integer
- // within Min and Max
- return ThreadLocalRandom
- .current()
- .nextInt(1, size + 1);
- }
- public TVRealityList(int pos, ArrayList<String> lista, int k) {
- this.pos = pos;
- this.lista = lista;
- this.k = k;
- }
- public int getPos() {
- return pos;
- }
- public void setPos(int pos) {
- this.pos = pos;
- }
- public ArrayList<String> getLista() {
- return lista;
- }
- public void setLista(ArrayList<String> lista) {
- this.lista = lista;
- }
- public int getK() {
- return k;
- }
- public void setK(int k) {
- this.k = k;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement