|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.elib.prim.ScriptMaker
Untamed: From a Java class, obtain a corresponding Script enabling its tamed behavior to be invoked from ELib. XXX BUG: mutable static state. Fortunately, it's a semantics free cache, so it doesn't actually violate capability semantics. Unfortunately, it needs to be synchronized, and isn't yet.
Field Summary | |
private FlexMap |
myScripts
maps java classes to scripts |
private static String[][] |
Promotions
All instances of the left hand (key) types act (in E) as if they are instances of the right hand (value) types. |
private static String[][] |
Sugarings
To the E programmer, the left hand (key) types seem to have methods according to this Java type, but as modified (sugared) by the right hand (value) types. |
static ScriptMaker |
THE_ONE
Enabled: |
private static HashMap |
ThePromotions
Maps fq class names to the fqn of the classes they promote to. |
private static EMap |
TheSugars
Maps fq class names to the fqn of the classes that sugar them. |
Constructor Summary | |
private |
ScriptMaker()
|
Method Summary | |
private void |
inherit(VTable vTable,
Class donor,
SafeJ safeJ)
|
Script |
instanceScript(Class clazz)
Enabled: |
static Class |
OptPromotion(Class clazz)
Enabled: Map a class to the class it promotes to, or null if none |
static Class |
OptSugar(Class clazz)
Enabled: Map a class to its sugaring class, or null if it doesn't have one |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final String[][] Promotions
This often happens by converting them first.
This is much like the Simplifications in Equalizer, with some differences.
private static HashMap ThePromotions
ThePromotions is initialized lazily in order to avoid possible circular static initialization dependencies. Uses legacy HashMap rather than EMap in order to avoid a circular dependency by way of the Equalizer.
private static final String[][] Sugarings
private static EMap TheSugars
public static final ScriptMaker THE_ONE
private final FlexMap myScripts
Constructor Detail |
private ScriptMaker()
Method Detail |
public static Class OptPromotion(Class clazz)
public static Class OptSugar(Class clazz)
private void inherit(VTable vTable, Class donor, SafeJ safeJ)
public Script instanceScript(Class clazz)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |