src/main/java/cz/diribet/aqdef/model/AqdefObjectModel.java
/**
	 * Removes all values of the given part that do not match the given predicate.
	 *
	 * @param part
	 * @param predicate
	 */
Removes all values of the given part that do not match the given predicate.
@param part
@param predicate
Removes all values of the given part that do not match the given predicate . @param part @param predicate
public void filterValues(PartEntries part, ValueOfSinglePartPredicate predicate) {
		Map<CharacteristicIndex, CharacteristicEntries> characteristicsOfPart = characteristicEntries.get(part.getIndex());
		if (characteristicsOfPart != null) {
			characteristicsOfPart.forEach((characteristicIndex, characteristic) -> {
				Map<CharacteristicIndex, Map<ValueIndex, ValueEntries>> valuesOfPart = valueEntries.get(part.getIndex());
				if (valuesOfPart != null) {
					Map<ValueIndex, ValueEntries> values = valuesOfPart.get(characteristic.getIndex());
					if (values != null) {
						Iterator<Entry<ValueIndex, ValueEntries>> iterator = values.entrySet().iterator();
						while (iterator.hasNext()) {
							Entry<ValueIndex, ValueEntries> entry = iterator.next();
							ValueEntries value = entry.getValue();
							if (!predicate.test(characteristic, value)) {
								iterator.remove();
							}
						}
					}
				}
			});
		}
	}
public void filterValues ( PartEntries part , ValueOfSinglePartPredicate predicate ) { Map < CharacteristicIndex , CharacteristicEntries > characteristicsOfPart = characteristicEntries . get ( part . getIndex ( ) ) ; if ( characteristicsOfPart != null ) { characteristicsOfPart . forEach ( ( characteristicIndex , characteristic ) -> { Map < CharacteristicIndex , Map < ValueIndex , ValueEntries > > valuesOfPart = valueEntries . get ( part . getIndex ( ) ) ; if ( valuesOfPart != null ) { Map < ValueIndex , ValueEntries > values = valuesOfPart . get ( characteristic . getIndex ( ) ) ; if ( values != null ) { Iterator < Entry < ValueIndex , ValueEntries > > iterator = values . entrySet ( ) . iterator ( ) ; while ( iterator . hasNext ( ) ) { Entry < ValueIndex , ValueEntries > entry = iterator . next ( ) ; ValueEntries value = entry . getValue ( ) ; if ( ! predicate . test ( characteristic , value ) ) { iterator . remove ( ) ; } } } } } ) ; } }
Removes all values of the given part that do not match the given predicate.
Removes all values of the given part that do not match the given predicate .