private void recomputeValues() { if (outputTriple == null) { return; } Visitor visitor = visitable -> { if (visitable instanceof PrismValue) { ((PrismValue)visitable).recompute(getPrismContext()); } }; outputTriple.accept(visitor); }
public void addValueToReplace(V newValue) { checkMutability(); if (valuesToAdd != null) { throw new IllegalStateException("Delta " + this + " already has values to add, attempt to set value to replace"); } if (valuesToDelete != null) { throw new IllegalStateException("Delta " + this + " already has values to delete, attempt to set value to replace"); } if (valuesToReplace == null) { valuesToReplace = newValueCollection(); } if (newValue != null) { valuesToReplace.add(newValue); newValue.setParent(this); newValue.recompute(); } }
public void setValueToReplace(V newValue) { checkMutability(); if (valuesToAdd != null) { throw new IllegalStateException("Delta " + this + " already has values to add, attempt to set value to replace"); } if (valuesToDelete != null) { throw new IllegalStateException("Delta " + this + " already has values to delete, attempt to set value to replace"); } if (valuesToReplace == null) { valuesToReplace = newValueCollection(); } else { valuesToReplace.clear(); } if (newValue != null) { valuesToReplace.add(newValue); newValue.setParent(this); newValue.recompute(); } }
public void setValuesToReplace(V... newValues) { checkMutability(); if (valuesToAdd != null) { throw new IllegalStateException("Delta " + this + " already has values to add, attempt to set value to replace"); } if (valuesToDelete != null) { throw new IllegalStateException("Delta " + this + " already has values to delete, attempt to set value to replace"); } if (valuesToReplace == null) { valuesToReplace = newValueCollection(); } else { valuesToReplace.clear(); } for (V val : newValues) { valuesToReplace.add(val); val.setParent(this); val.recompute(); } }
public void setValuesToReplace(Collection<V> newValues) { checkMutability(); if (newValues == null) { return; } if (valuesToAdd != null) { throw new IllegalStateException("Delta " + this + " already has values to add ("+valuesToAdd+"), attempt to set value to replace ("+newValues+")"); } if (valuesToDelete != null) { throw new IllegalStateException("Delta " + this + " already has values to delete, attempt to set value to replace"); } if (valuesToReplace == null) { valuesToReplace = newValueCollection(); } else { valuesToReplace.clear(); } for (V val : newValues) { valuesToReplace.add(val); val.setParent(this); val.recompute(); } }
public void addValueToDelete(V newValue) { checkMutability(); if (valuesToReplace != null) { throw new IllegalStateException("Delta " + this + " already has values to replace ("+valuesToReplace+"), attempt to set value to delete ("+newValue+")"); } if (valuesToDelete == null) { valuesToDelete = newValueCollection(); } if (containsEquivalentValue(valuesToDelete, newValue)) { return; } valuesToDelete.add(newValue); newValue.setParent(this); newValue.recompute(); }
public void addEstimatedOldValue(V newValue) { checkMutability(); if (estimatedOldValues == null) { estimatedOldValues = newValueCollection(); } if (PrismValueCollectionsUtil.containsRealValue(estimatedOldValues,newValue)) { return; } estimatedOldValues.add(newValue); newValue.setParent(this); newValue.recompute(); }
public void addValueToAdd(V newValue) { checkMutability(); if (valuesToReplace != null) { throw new IllegalStateException("Delta " + this + " already has values to replace ("+valuesToReplace+"), attempt to add value ("+newValue+") is an error"); } if (valuesToAdd == null) { valuesToAdd = newValueCollection(); } if (PrismValueCollectionsUtil.containsRealValue(valuesToAdd,newValue)) { return; } valuesToAdd.add(newValue); newValue.setParent(this); newValue.recompute(); }