All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.snapscript.core.EntityTree Maven / Gradle / Ivy

package org.snapscript.core;

import org.snapscript.common.Cache;
import org.snapscript.common.CopyOnWriteCache;
import org.snapscript.core.type.Type;

public class EntityTree  {

   private final EntityCache> cache;
   
   public EntityTree() {
      this.cache = new EntityCache>();
   }
   
   public Cache get(Type type) {
      Cache table = cache.fetch(type);
      
      if(table == null) {
         table = new CopyOnWriteCache();
         cache.cache(type, table);
      }
      return table;
      
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy