// Collection of code snippets by Arne Vajhøj 
// (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) 
package test.custom;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class TestCustom {
    public class DataPair {
        private String x;
        private String fx;
        public DataPair(String x, String fx) {
            this.x = x;
            this.fx = fx;
        }
        public String getX() {
            return x;
        }
        public String getFx() {
            return fx;
        }
    }
    public List<DataPair> getData2() {
        List<DataPair> res = new ArrayList<>();
        for(int i = 1; i <= 10; i++) {
            res.add(new DataPair(Integer.toString(i), Integer.toString(i * i)));
        }
        return res;
    }
    public List<DataPair> getData3() {
        List<DataPair> res = new ArrayList<>();
        for(int i = 1; i <= 10; i++) {
            res.add(new DataPair(Integer.toString(i), Integer.toString(i * i * i)));
        }
        return res;
    }
}
