1 package org.simantics.structural.synchronization.base;
\r
3 import java.util.function.BiConsumer;
\r
5 public interface SolverNameUtil {
\r
7 String getFreshName(String parentName, String name);
\r
8 String ensureNameIsVariationOf(String parentName, int id, String name);
\r
11 * The name utility can internally keep track of
\r
12 * <code>suggested name -> generated
\r
13 * fresh name</code> associations that it has had to perform during its
\r
14 * lifetime in {@link #getFreshName(String, String)}. If the implementation
\r
15 * keeps track of these renames, the purpose of this method is to check
\r
16 * whether at the time of invocation it is possible to rename the solver
\r
17 * components to their suggested names or not. For every rename that is
\r
18 * performed, the specified consumer shall be invoked with the arguments
\r
19 * <code>(previous name, new name)</code> after the rename has been
\r
23 * This method is intended to be invoked right at the end of
\r
27 * a binary consumer that takes as first argument the previous
\r
28 * name of the renamed component and as second argument the new
\r
29 * (current) name of the component or <code>null</code> to skip
\r
30 * callback invocation
\r
32 default void applySuggestedNames(BiConsumer<String, String> callback) {}
\r