i.InternedClasses Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javaee-rt Show documentation
Show all versions of javaee-rt Show documentation
An Execution Environment for Java SCOREs
package i;
import java.util.IdentityHashMap;
/**
* Really just a high-level wrapper over an IdentityHashMap to contain real classes to shadow classes.
* This exists because some of the logic was duplicated in a few places.
*/
public class InternedClasses {
private final IdentityHashMap, s.java.lang.Class>> internedClassWrappers;
public InternedClasses() {
this.internedClassWrappers = new IdentityHashMap<>();
}
public InternedClasses(InternedClasses src) {
this.internedClassWrappers = new IdentityHashMap<>(src.internedClassWrappers);
}
public s.java.lang.Class get(Class underlyingClass) {
s.java.lang.Class> internedClass = this.internedClassWrappers.get(underlyingClass);
if (null == internedClass) {
internedClass = new s.java.lang.Class<>(underlyingClass);
this.internedClassWrappers.put(underlyingClass, internedClass);
}
return (s.java.lang.Class)internedClass;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy