/** * retrieve the live value represented by this immutable literal. An * interesting property of knowing something cannot change at compile * time is that all information necessary to construct it is also known * at compile time. We don't pre-create these since we don't want to * assume the cost of constructing literals which may never be used. */ @Override public T retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) { return cachedObject(context); } }
/** * Returns the cached object. If not then it asks class to create an * object to cache. */ public T cachedObject(ThreadContext context) { if (!isCached()) cachedObject = createCacheObject(context); return cachedObject; }
/** * Returns the cached object. If not then it asks class to create an * object to cache. */ public Object cachedObject(ThreadContext context) { if (!isCached()) cachedObject = createCacheObject(context); return cachedObject; }
/** * retrieve the live value represented by this immutable literal. An * interesting property of knowing something cannot change at compile * time is that all information necessary to construct it is also known * at compile time. We don't pre-create these since we don't want to * assume the cost of constructing literals which may never be used. */ @Override public T retrieve(ThreadContext context, IRubyObject self, StaticScope currScope, DynamicScope currDynScope, Object[] temp) { return cachedObject(context); } }
/** * Returns the cached object. If not then it asks class to create an * object to cache. */ public Object cachedObject(ThreadContext context) { if (!isCached()) cachedObject = createCacheObject(context); return cachedObject; }
/** * retrieve the live value represented by this immutable literal. An * interesting property of knowing something cannot change at compile * time is that all information neccesary to construct it is also known * at compile time. We don't pre-create these since we don't want to * assume the cost of constructing literals which may never be used. */ @Override public Object retrieve(ThreadContext context, IRubyObject self, DynamicScope currDynScope, Object[] temp) { return cachedObject(context); } }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(value.toString()); }
/** * Returns the cached object. If not then it asks class to create an * object to cache. */ public T cachedObject(ThreadContext context) { if (!isCached()) cachedObject = createCacheObject(context); return cachedObject; }
/** * retrieve the live value represented by this immutable literal. An * interesting property of knowing something cannot change at compile * time is that all information neccesary to construct it is also known * at compile time. We don't pre-create these since we don't want to * assume the cost of constructing literals which may never be used. */ @Override public Object retrieve(ThreadContext context, IRubyObject self, DynamicScope currDynScope, Object[] temp) { return cachedObject(context); } }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(number); }
@Override public Object createCacheObject(ThreadContext context) { return RubyRational.newRationalRaw(context.runtime, (IRubyObject) numerator.cachedObject(context), (IRubyObject) denominator.cachedObject(context)); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(name); }
@Override public Object createCacheObject(ThreadContext context) { return RubyRational.newRationalRaw(context.runtime, (IRubyObject) numerator.cachedObject(context), (IRubyObject) denominator.cachedObject(context)); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(value); }
@Override public Object createCacheObject(ThreadContext context) { return RubyComplex.newComplexRaw(context.runtime, context.runtime.newFixnum(0), (IRubyObject) number.cachedObject(context)); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(value.toString()); }
@Override public Object createCacheObject(ThreadContext context) { return RubyComplex.newComplexRaw(context.runtime, context.runtime.newFixnum(0), (IRubyObject) number.cachedObject(context)); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(truthy); }