Convert the current field value to an index.
@return The zero-based index of the location of this field (-1 = none).
428058
public int convertFieldToIndex()
    {
        int index = -1;
        FieldInfo field = this.getField();
        if (field != null)
        {
            if (!field.isNull())
            {
                boolean bFound = false;
                Object bookmark = null;
                try   {
                    if (field instanceof ReferenceField)    // Always
                        if (((ReferenceField)field).getReferenceRecord() == m_record)
                            bookmark = ((ReferenceField)field).getReference().getHandle(DBConstants.BOOKMARK_HANDLE);
                } catch (DBException ex)    {
                    bookmark = null;
                }
                if (bookmark == null)
                    if (field instanceof IntegerField)
                        bookmark = field.getData();
                Object bookmarkRecord = null;
                try   {
                    bookmarkRecord = m_record.getTable().getHandle(m_iHandleType);
                } catch (DBException ex)    {
                } 

                if ((m_record.getEditMode() == Constants.EDIT_IN_PROGRESS) ||
                    (m_record.getEditMode() == Constants.EDIT_CURRENT))
                        if (bookmarkRecord != null)
                            if (bookmarkRecord.equals(bookmark))
                                bFound = true;  // Don't re-read the record... It is current!
                if (bFound == false)
                    if (bookmark != null)
                {   // First, try to look up the field (a bookmark) in the grid table.
                    index = m_gridTable.bookmarkToIndex(bookmark, DBConstants.BOOKMARK_HANDLE);   // Find the index of this record in the list
                    if (index != -1)
                    {
                        if (m_bIncludeBlankOption)
                            index++;
                        return index;
                    }

                    try   {
                        bFound = (m_record.getTable().setHandle(bookmark, m_iHandleType) != null);
                    } catch (DBException e)   {
                        bFound = false;
                    }
                } 
                if (bFound)
                {
                    index = m_gridTable.bookmarkToIndex(bookmark, DBConstants.BOOKMARK_HANDLE);   // Find the index of this record in the list
                    if (index != -1)
                    {
                        try {
                            m_gridTable.get(index); // Make sure I'm actually pointing to this record (fast - should be cached)
                        } catch (DBException e) {
                            e.printStackTrace();    // Never
                        } 
                    }
                    if (m_bIncludeBlankOption)
                        index++;
                    if (index != -1)
                        return index;
                }
            }
        }
        this.moveToIndex(-1);  // Move off any valid record
        if (m_bIncludeBlankOption)
            if (field != null)
                if (field.isNull())
                    return 0; // Null = Select the "Blank" line
        return -1;
    }
622638
public Object getValueByPosition(Integer position) throws NoSuchFieldException {
        String name = null;
        Object value = null;

        name = this.getNameByPosition(position);

        if (name != null) {
            value = this.getValue(name);
        } else {
            throw new NoSuchFieldException();
        }

        return value;
    }
32194
public int indexOf(DateTimeFieldType type) {
        for (int i = 0, isize = size(); i < isize; i++) {
            if (getFieldType(i) == type) {
                return i;
            }
        }
        return -1;
    }
908705
public int valueToIndex(Object value)
    {
        if (value != null)
            if (!(value instanceof String))
                value = value.toString();
        if ((m_record != null) && (m_strIndexValue != null))
        {
            try   {
                FieldTable table = m_record.getTable();
                for (int iIndex = 0; ; iIndex++)
                {
                    if (table.get(iIndex) == null)  // I use get, so the index matches the index of JComboBox
                        break;
                    FieldInfo field = m_record.getField(m_strIndexValue);
                    if (field == null)
                        field = m_record.getField(0);
                    String strValue = field.getString();
                    if ((strValue != null) && (strValue.length() > 0))
                        if (strValue.equals(value))
                            return iIndex + 1;
                }
            } catch (Exception ex)  {
                ex.printStackTrace();
            }
        }
        else
        {
            this.setSelectedItem(value);
            if (this.getSelectedIndex() != -1)
                return this.getSelectedIndex();
        }
        return 0;
    }
1165015
public int getIndex(String feature)
	{
		//logger.debug("FeatureIndex.get : " + feature + "(" + count + ")");
		Integer index = (Integer) map.get(feature);

		if (index == null)
			return -1;

		return index.intValue();
	}
347599
public long getCurrentPosition() {
        try {
            return mPlayer.getCurrentPosition();
        } catch(Exception e) {
            Log.e(TAG, e.getMessage());
            return -1;
        }
    }
187208
public T min() {
        if (sum == 0)
            return null;
        int minCount = Integer.MAX_VALUE;
        int minIndex = -1;
        for (TIntIntIterator it = indexToCount.iterator(); it.hasNext(); ) {
            it.advance();
            if (it.value() < minCount) {
                minIndex = it.key();
                minCount = it.value();
            }
        }
        return objectIndices.lookup(minIndex);
    }
643814
public int indexOf(T x) {
    int r=Arrays.binarySearch(data,x);
    return(r>=0?r:-1);
  }
519301
def current_index(self):
        """"""
        i = self._parent.proxy_model.mapToSource(self._parent.currentIndex())
        return i
962386
public int fieldIndex(String field) {
    Integer ret = mIndex.get(field);
    if (ret == null) {
      throw new IllegalArgumentException(field + " does not exist");
    }
    return ret;
  }
83344
@Deprecated
  public OIndex<?> getIndex() {
    Set<OIndex<?>> indexes = owner.getInvolvedIndexes(name);
    if (indexes != null && !indexes.isEmpty())
      return indexes.iterator().next();
    return null;
  }
663529
public FieldDefinition getField(int index) {
        if (index >= fields.size() || index < 0) {
            return null;
        }
        Iterator<FieldDefinition> iter = fields.values().iterator();
        for (int j = 0; j < index ; j++) {
            iter.next();
        }
        return iter.next();
    }
66801
def _zero_based_index(self, onebased: Union[int, str]) -> int:
        """"""
        result = int(onebased)
        if result > 0:
            result -= 1
        return result
1013490
def index data
      current = @first
      i = 0
      while !current.nil?
        return i if current.data == data
        current = current.next
        i += 1
      end
      nil
    end
75866
public int convertIndexToField(int index, boolean bDisplayOption, int iMoveMode)
    {       // Must be overidden
        if (this.getNextConverter() != null)
            return this.getNextConverter().convertIndexToField(index, bDisplayOption, iMoveMode);
        else
            return super.convertIndexToField(index, bDisplayOption, iMoveMode);
    }
1336756
public Index<SecondaryTable<T>> getOrCreateIndex()
   {
      List<Node> nodeList = childNode.get("index");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new IndexImpl<SecondaryTable<T>>(this, "index", childNode, nodeList.get(0));
      }
      return createIndex();
   }
1036310
int getValue() {

        if (this.matches(Selector.NORTHERN_COURT)) {
            return (this.index - NORTHERN_NENGOS.length + NENGO_OEI.index - Nengo.SHOWA.index + 1);
        }

        return (this.index - Nengo.SHOWA.index + 1);

    }