public static synchronized <T> ListType<T> getInstance(AbstractType<T> elements, boolean isMultiCell) { Map<AbstractType<?>, ListType> internMap = isMultiCell ? instances : frozenInstances; ListType<T> t = internMap.get(elements); if (t == null) { t = new ListType<T>(elements, isMultiCell); internMap.put(elements, t); } return t; }
public static synchronized <T> ListType<T> getInstance(AbstractType<T> elements, boolean isMultiCell) { Map<AbstractType<?>, ListType> internMap = isMultiCell ? instances : frozenInstances; ListType<T> t = internMap.get(elements); if (t == null) { t = new ListType<T>(elements, isMultiCell); internMap.put(elements, t); } return t; }
public static synchronized <T> ListType<T> getInstance(AbstractType<T> elements, boolean isMultiCell) { Map<AbstractType<?>, ListType> internMap = isMultiCell ? instances : frozenInstances; ListType<T> t = internMap.get(elements); if (t == null) { t = new ListType<T>(elements, isMultiCell); internMap.put(elements, t); } return t; }
public static <T> ListType<T> getInstance(AbstractType<T> elements, final boolean isMultiCell) { ConcurrentMap<AbstractType<?>, ListType> internMap = isMultiCell ? instances : frozenInstances; ListType<T> t = internMap.get(elements); if (t == null) t = internMap.computeIfAbsent(elements, K -> new ListType<>(K, isMultiCell) ); return t; }
public static synchronized <T> ListType<T> getInstance(AbstractType<T> elements, boolean isMultiCell) { Map<AbstractType<?>, ListType> internMap = isMultiCell ? instances : frozenInstances; ListType<T> t = internMap.get(elements); if (t == null) { t = new ListType<T>(elements, isMultiCell); internMap.put(elements, t); } return t; }