Code example for ArrayList

Methods: contains

0
     * @param cursorPosition A Cursor position 
     * @return The mapped-to list position or REMOVED 
     */ 
    public int getListPosition(int cursorPosition) {
        if (mRemovedCursorPositions.contains(cursorPosition)) {
            return REMOVED;
        } 
 
        int index = mListMapping.indexOfValue(cursorPosition);
        if (index < 0) {
            return cursorPosition;
        } else { 
            return mListMapping.keyAt(index);
        } 
    } 
 
 
}