org.snapscript.core.EntityTree Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of snap Show documentation
Show all versions of snap Show documentation
Dynamic scripting for the JVM
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;
}
}