src/main/java/cz/diribet/aqdef/model/AqdefObjectModel.java
/**
	 * Removes all values that do not match the given predicate.
	 *
	 * @param predicate
	 */
Removes all values that do not match the given predicate.
@param predicate
Removes all values that do not match the given predicate . @param predicate
public void filterValues(ValuePredicate predicate) {
		partEntries.forEach((partIndex, part) -> {
			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(part, characteristic, value)) {
									iterator.remove();
								}
							}
						}
					}
				});
			}
		});
	}
public void filterValues ( ValuePredicate predicate ) { partEntries . forEach ( ( partIndex , part ) -> { 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 ( part , characteristic , value ) ) { iterator . remove ( ) ; } } } } } ) ; } } ) ; }
Removes all values that do not match the given predicate.
Removes all values that do not match the given predicate .