private List < Entry > removeValues ( Collection < ? > values , boolean ifMatch ) { LinkedList < Entry > results = null ; // Record the list of entries that are removed, but start at the end of the values (so the indexes are correct) ListIterator < ? > iter = this . values . listIterator ( size ( ) ) ; while ( iter . hasPrevious ( ) ) { int index = iter . previousIndex ( ) ; Object value = iter . previous ( ) ; if ( ifMatch == values . contains ( value ) ) { iter . remove ( ) ; if ( results == null ) { results = new LinkedList <> ( ) ; } results . addFirst ( new BasicEntry ( index , value ) ) ; } } return results != null ? results : Collections . < Entry > emptyList ( ) ; }
Remove some of the values in this array .