I\'m using a TreeSet and I\'d quite simply like to find the index of a number in the set. Is there a nice way to do this that actually makes use
here show my function:
//FUNCTION FOR GIVE A STRING POSITION INTO TREESET
private static void get_posistion(TreeSet abre, String codig) {
Iterator iterator;
iterator = abre.iterator();
int cont = 0;
String prova = "";
while (iterator.hasNext()) {
prova = iterator.next().toString();
if (codig.equals(prova)) {
System.out.println(cont);
} else {
cont++;
}
}
}