@JRubyMethod(name = "[]") public IRubyObject op_aref(ThreadContext context, IRubyObject key) { IRubyObject value = map.get(key); if (value != null) return value; return context.nil; }
public synchronized Value get(Key key) { cleanReferences(); KeyedReference<Key, Value> reference = references.get(key); if (reference == null) { return null; } return reference.get(); }
@JRubyMethod(name = "[]=") public IRubyObject op_aref(ThreadContext context, IRubyObject key, IRubyObject value) { map.put(key, value); return context.runtime.newFixnum(System.identityHashCode(value)); }
@JRubyMethod(name = "[]=") public IRubyObject op_aref(ThreadContext context, IRubyObject key, IRubyObject value) { map.put(key, value); return context.runtime.newFixnum(System.identityHashCode(value)); }
@JRubyMethod(name = "[]") public IRubyObject op_aref(ThreadContext context, IRubyObject key) { IRubyObject value = map.get(key); if (value != null) return value; return context.nil; }
@JRubyMethod(name = "[]=") public IRubyObject op_aref(ThreadContext context, IRubyObject key, IRubyObject value) { map.put(key, value); return context.runtime.newFixnum(System.identityHashCode(value)); }
public synchronized Value get(Key key) { cleanReferences(); KeyedReference<Key, Value> reference = references.get(key); if (reference == null) { return null; } return reference.get(); }
@JRubyMethod(name = "[]") public IRubyObject op_aref(ThreadContext context, IRubyObject key) { IRubyObject value = map.get(key); if (value != null) return value; return context.nil; }
@JRubyMethod(name = "[]=") public IRubyObject op_aref(ThreadContext context, IRubyObject key, IRubyObject value) { map.put(key, value); return context.runtime.newFixnum(System.identityHashCode(value)); }
public synchronized void put(Key key, Value value) { cleanReferences(); references.put(key, new KeyedReference(value, key, deadReferences)); }
@JRubyMethod(name = "[]") public IRubyObject op_aref(ThreadContext context, IRubyObject key) { IRubyObject value = map.get(key); if (value != null) return value; return context.nil; }
public synchronized void put(Key key, Value value) { cleanReferences(); references.put(key, new KeyedReference(value, key, deadReferences)); }
@JRubyMethod(name = "key?") public IRubyObject key_p(ThreadContext context, IRubyObject key) { return context.runtime.newBoolean(map.get(key) != null); }
@JRubyMethod(name = "key?") public IRubyObject key_p(ThreadContext context, IRubyObject key) { return context.runtime.newBoolean(map.get(key) != null); }