Class NameMgr<T>


  • public class NameMgr<T>
    extends java.lang.Object
    Management of intern'ed names T that can be used as keys. alloc(java.lang.String, java.util.function.Function<java.lang.String, T>) creates an intern'ed T; if the object with the same name has already been created, return the original. There is only ever one object for a given name.

    T == can be used to test of name match, though providing .hashCode and .equals is preferred.

    • Constructor Summary

      Constructors 
      Constructor Description
      NameMgr()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T alloc​(java.lang.String name, java.util.function.Function<java.lang.String,​T> maker)
      register, creating an object if necessary
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NameMgr

        public NameMgr()
    • Method Detail

      • alloc

        public T alloc​(java.lang.String name,
                       java.util.function.Function<java.lang.String,​T> maker)
        register, creating an object if necessary