question: private Cell detectAndAddHit ( float x , float y ) { final Cell cell = checkForNewHit ( x , y ) ; if ( cell != null ) { Cell fillInGapCell = null ; final ArrayList < Cell > pattern = mPattern ; if ( ! pattern . isEmpty ( ) ) { final Cell lastCell = pattern . get ( pattern . size ( ) - 1 ) ; int dRow = cell . row - lastCell . row ; int dColumn = cell . column - lastCell . column ; int fillInRow = lastCell . row ; int fillInColumn = lastCell . column ; if ( Math . abs ( dRow ) == 2 && Math . abs ( dColumn ) != 1 ) { fillInRow = lastCell . row + ( ( dRow > 0 ) ? 1 : - 1 ) ; } if ( Math . abs ( dColumn ) == 2 && Math . abs ( dRow ) != 1 ) { fillInColumn = lastCell . column + ( ( dColumn > 0 ) ? 1 : - 1 ) ; } fillInGapCell = Cell . of ( fillInRow , fillInColumn ) ; } if ( fillInGapCell != null && ! mPatternDrawLookup [ fillInGapCell . row ] [ fillInGapCell . column ] ) { addCellToPattern ( fillInGapCell ) ; } addCellToPattern ( cell ) ; if ( mEnableHapticFeedback ) { performHapticFeedback ( HapticFeedbackConstants . VIRTUAL_KEY , HapticFeedbackConstants . FLAG_IGNORE_VIEW_SETTING | HapticFeedbackConstants . FLAG_IGNORE_GLOBAL_SETTING ) ; } return cell ; } return null ; }
target:  Determines whether the point x, y will add a new point to the current pattern (in addition to finding the cell, also makes heuristic choices such as filling in gaps based on current pattern).