code: public int getIndex(Object key) {
      Integer i = (Integer) nset.get(key);
      if (i == null) {
        return -1;
      }
      else {
        return i.intValue();
      }
    }
docs: Returns the index for the specified key or -1 if specified value is not contain in this set.
  @param key The key to be checked.
  @return the index for the specified value or -1 if specified value is not contain in this set