Java tutorial
//package com.java2s; import java.util.List; public class Main { public static double position(String s, List<String> ss) { double p = -1d; for (int i = 0; i < ss.size(); i++) { if (s.equals(ss.get(i))) { p = Double.parseDouble(i + ""); break; } } return p; } }