Files
VisualSapfor/src/Common/CurrentAnchestor.java

31 lines
947 B
Java
Raw Normal View History

package Common;
import Common.Utils.TextLog;
import Common_old.Current;
import java.util.LinkedHashMap;
public interface CurrentAnchestor {
//-
LinkedHashMap<CurrentAnchestor, Object> objects = new LinkedHashMap<>();
static Object get(CurrentAnchestor name) {
if (!objects.containsKey(name))
objects.put(name,null);
return objects.get(name);
}
static Object set(CurrentAnchestor name, Object object) {
if (objects.containsKey(name))
objects.replace(name, object);
else objects.put(name, object);
return object;
}
default String getDescription(){
return "?";
}
static boolean Check(TextLog Log, CurrentAnchestor... names) {
for (CurrentAnchestor name : names)
if (CurrentAnchestor.get(name) == null)
Log.Writeln_(name.getDescription() + " не выбран(а)");
return Log.isEmpty();
}
}