/// <summary>For supplying a new instance for the global methods to use.</summary>
        /// <returns>the previous global interner.</returns>
        public static Interner <object> SetGlobal(Interner <object> interner)
        {
            Interner <object> oldInterner = Interner.interner;

            Interner.interner = interner;
            return(oldInterner);
        }
 /// <summary>Test method: interns its arguments and says whether they == themselves.</summary>
 public static void Main(string[] args)
 {
     foreach (string str in args)
     {
         System.Console.Out.WriteLine(Interner.GlobalIntern(str) == str);
     }
 }
Beispiel #3
0
 public static SynchronizedInterner <T> NewSynchronizedInterner <T>(Interner <T> interner, object mutex)
 {
     return(new SynchronizedInterner <T>(interner, mutex));
 }
Beispiel #4
0
 public static SynchronizedInterner <T> NewSynchronizedInterner <T>(Interner <T> interner)
 {
     return(new SynchronizedInterner <T>(interner));
 }