/** * Returns index of the object a <code>List</code> object of <code>PersistentObject</code>s that * contains an encoded key (<code>getEncodedKey()</code>). * * @param list <code>List</code> of objects to search. * @param encodedKey key obtained via <code>getEncodedKey()</code>. * @return index of object on list or <code>-1</code> if not found. * @see net.sf.jrf.domain.PersistentObject#getEncodedKey() * @see #findByKey(List,String) */ public static int findIndexByKey(List list, String encodedKey) { for (int i = 0; i < list.size(); i++) { PersistentObject p = (PersistentObject) list.get(i); if (p.getEncodedKey().equals(encodedKey)) { return i; } } return -1; }