|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyHash
public class RubyHash
Implementation of the Hash class. Concurrency: no synchronization is required among readers, but all users must synchronize externally with writers.
Nested Class Summary | |
---|---|
static class |
RubyHash.Visitor
|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry<K,V> |
Field Summary | |
---|---|
static long |
collisions
|
Fields inherited from class org.jruby.RubyObject |
---|
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
RubyHash(Ruby runtime)
|
|
RubyHash(Ruby runtime,
IRubyObject defaultValue)
|
|
RubyHash(Ruby runtime,
java.util.Map valueMap,
IRubyObject defaultValue)
|
|
RubyHash(Ruby runtime,
RubyClass klass)
|
Method Summary | |
---|---|
IRubyObject |
aref(IRubyObject key)
Deprecated. use RubyHash.op_aref instead |
IRubyObject |
aset(IRubyObject key,
IRubyObject value)
Deprecated. use RubyHash.op_aset instead |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
RubyHash |
convertToHash()
Tries to convert this object to a Ruby Hash using the "to_hash" method. |
static IRubyObject |
create(ThreadContext context,
IRubyObject recv,
IRubyObject[] args,
Block block)
rb_hash_s_create |
static RubyClass |
createHashClass(Ruby runtime)
|
IRubyObject |
default_proc()
rb_hash_default_proc |
IRubyObject |
default_value_get(ThreadContext context,
IRubyObject[] args)
rb_hash_default |
IRubyObject |
default_value_set(IRubyObject defaultValue)
rb_hash_set_default |
RubyHash |
delete_if(ThreadContext context,
Block block)
rb_hash_delete_if |
IRubyObject |
delete(ThreadContext context,
IRubyObject key,
Block block)
rb_hash_delete |
java.util.Set |
directEntrySet()
|
java.util.Set |
directKeySet()
|
java.util.Collection |
directValues()
|
RubyHash |
each_key(ThreadContext context,
Block block)
rb_hash_each_key |
RubyHash |
each_pair(ThreadContext context,
Block block)
rb_hash_each_pair |
RubyHash |
each_value(ThreadContext context,
Block block)
rb_hash_each_value |
RubyHash |
each(ThreadContext context,
Block block)
rb_hash_each |
RubyBoolean |
empty_p()
rb_hash_empty_p |
java.util.Set |
entrySet()
|
boolean |
equals(java.lang.Object other)
This method is just a wrapper around the Ruby "==" method, provided so that RubyObjects can be used as keys in the Java HashMap object underlying RubyHash. |
IRubyObject |
fastARef(IRubyObject key)
|
void |
fastASet(IRubyObject key,
IRubyObject value)
|
boolean |
fastDelete(IRubyObject key)
|
IRubyObject |
fetch(ThreadContext context,
IRubyObject[] args,
Block block)
rb_hash_fetch |
java.lang.Object |
get(java.lang.Object key)
|
IRubyObject |
getIfNone()
|
java.lang.Class |
getJavaClass()
Will return the Java interface that most closely can represent this object, when working through JAva integration translations. |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. |
RubyBoolean |
has_key_p(IRubyObject key)
rb_hash_has_key |
RubyBoolean |
has_value_p(ThreadContext context,
IRubyObject expected)
rb_hash_has_value |
boolean |
hasDefaultProc()
|
IRubyObject |
index(ThreadContext context,
IRubyObject expected)
rb_hash_index |
RubyArray |
indices(ThreadContext context,
IRubyObject[] indices)
rb_hash_indexes |
RubyHash |
initialize_copy(ThreadContext context,
IRubyObject other)
rb_hash_replace |
IRubyObject |
initialize(IRubyObject[] args,
Block block)
rb_hash_initialize |
IRubyObject |
inspect(ThreadContext context)
rb_hash_inspect |
RubyHash |
invert(ThreadContext context)
rb_hash_invert |
boolean |
isEmpty()
|
RubyArray |
keys()
rb_hash_keys |
java.util.Set |
keySet()
|
static void |
marshalTo(RubyHash hash,
MarshalStream output)
|
RubyHash |
merge_bang(ThreadContext context,
IRubyObject other,
Block block)
rb_hash_update |
RubyHash |
merge(ThreadContext context,
IRubyObject other,
Block block)
rb_hash_merge |
void |
modify()
rb_hash_modify |
static RubyHash |
newHash(Ruby runtime)
rb_hash_new |
static RubyHash |
newHash(Ruby runtime,
java.util.Map valueMap,
IRubyObject defaultValue)
rb_hash_new |
IRubyObject |
op_aref(ThreadContext context,
IRubyObject key)
rb_hash_aref |
IRubyObject |
op_aset(IRubyObject key,
IRubyObject value)
Deprecated. |
IRubyObject |
op_aset(ThreadContext context,
IRubyObject key,
IRubyObject value)
rb_hash_aset |
IRubyObject |
op_equal(ThreadContext context,
IRubyObject other)
rb_obj_equal Will by default use identity equality to compare objects. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
putAll(java.util.Map map)
|
RubyHash |
rb_clear()
rb_hash_clear |
RubyFixnum |
rb_size()
rb_hash_size |
RubyArray |
rb_values()
rb_hash_values |
RubyHash |
rehash()
rb_hash_rehash |
IRubyObject |
reject_bang(ThreadContext context,
Block block)
rb_hash_reject_bang |
RubyHash |
reject(ThreadContext context,
Block block)
rb_hash_reject |
java.lang.Object |
remove(java.lang.Object key)
|
RubyHash |
replace(ThreadContext context,
IRubyObject other)
rb_hash_replace |
IRubyObject |
select(ThreadContext context,
Block block)
rb_hash_select |
IRubyObject |
shift(ThreadContext context)
rb_hash_shift |
int |
size()
|
RubyArray |
sort(Block block)
rb_hash_sort |
RubyArray |
to_a()
rb_hash_to_a |
RubyHash |
to_hash()
rb_hash_to_hash |
IRubyObject |
to_s()
rb_hash_to_s & to_s_hash |
static RubyHash |
unmarshalFrom(UnmarshalStream input,
boolean defaultValue)
|
RubyArray |
values_at(ThreadContext context,
IRubyObject[] args)
rb_hash_values_at |
java.util.Collection |
values()
|
void |
visitAll(RubyHash.Visitor visitor)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
hashCode |
Field Detail |
---|
public static long collisions
Constructor Detail |
---|
public RubyHash(Ruby runtime, RubyClass klass)
public RubyHash(Ruby runtime)
public RubyHash(Ruby runtime, IRubyObject defaultValue)
public RubyHash(Ruby runtime, java.util.Map valueMap, IRubyObject defaultValue)
Method Detail |
---|
public static RubyClass createHashClass(Ruby runtime)
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyObject
org.jruby.runtime.ClassInde
public static IRubyObject create(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
public static final RubyHash newHash(Ruby runtime)
public static final RubyHash newHash(Ruby runtime, java.util.Map valueMap, IRubyObject defaultValue)
public void visitAll(RubyHash.Visitor visitor)
public IRubyObject initialize(IRubyObject[] args, Block block)
public IRubyObject default_value_get(ThreadContext context, IRubyObject[] args)
public IRubyObject default_value_set(IRubyObject defaultValue)
public IRubyObject default_proc()
public void modify()
public IRubyObject inspect(ThreadContext context)
public RubyFixnum rb_size()
public RubyBoolean empty_p()
public RubyArray to_a()
to_a
in class RubyObject
public IRubyObject to_s()
to_s
in class RubyObject
public RubyHash rehash()
public RubyHash to_hash()
public RubyHash convertToHash()
RubyObject
convertToHash
in interface IRubyObject
convertToHash
in class RubyObject
public final void fastASet(IRubyObject key, IRubyObject value)
@Deprecated public IRubyObject op_aset(IRubyObject key, IRubyObject value)
public IRubyObject op_aset(ThreadContext context, IRubyObject key, IRubyObject value)
public IRubyObject aset(IRubyObject key, IRubyObject value)
public IRubyObject aref(IRubyObject key)
public final IRubyObject fastARef(IRubyObject key)
public IRubyObject op_aref(ThreadContext context, IRubyObject key)
public IRubyObject fetch(ThreadContext context, IRubyObject[] args, Block block)
public RubyBoolean has_key_p(IRubyObject key)
public RubyBoolean has_value_p(ThreadContext context, IRubyObject expected)
public RubyHash each(ThreadContext context, Block block)
public RubyHash each_pair(ThreadContext context, Block block)
public RubyHash each_value(ThreadContext context, Block block)
public RubyHash each_key(ThreadContext context, Block block)
public RubyArray sort(Block block)
public IRubyObject index(ThreadContext context, IRubyObject expected)
public RubyArray indices(ThreadContext context, IRubyObject[] indices)
public RubyArray keys()
public RubyArray rb_values()
public IRubyObject op_equal(ThreadContext context, IRubyObject other)
RubyObject
op_equal
in interface IRubyObject
op_equal
in class RubyObject
public IRubyObject shift(ThreadContext context)
public final boolean fastDelete(IRubyObject key)
public IRubyObject delete(ThreadContext context, IRubyObject key, Block block)
public IRubyObject select(ThreadContext context, Block block)
public RubyHash delete_if(ThreadContext context, Block block)
public RubyHash reject(ThreadContext context, Block block)
public IRubyObject reject_bang(ThreadContext context, Block block)
public RubyHash rb_clear()
public RubyHash invert(ThreadContext context)
public RubyHash merge_bang(ThreadContext context, IRubyObject other, Block block)
public RubyHash merge(ThreadContext context, IRubyObject other, Block block)
public RubyHash initialize_copy(ThreadContext context, IRubyObject other)
public RubyHash replace(ThreadContext context, IRubyObject other)
public RubyArray values_at(ThreadContext context, IRubyObject[] args)
public boolean hasDefaultProc()
public IRubyObject getIfNone()
public static void marshalTo(RubyHash hash, MarshalStream output) throws java.io.IOException
java.io.IOException
public static RubyHash unmarshalFrom(UnmarshalStream input, boolean defaultValue) throws java.io.IOException
java.io.IOException
public java.lang.Class getJavaClass()
RubyObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyObject
public int size()
size
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
public void putAll(java.util.Map map)
putAll
in interface java.util.Map
public void clear()
clear
in interface java.util.Map
public boolean equals(java.lang.Object other)
RubyObject
equals
in interface java.util.Map
equals
in class RubyObject
public java.util.Set keySet()
keySet
in interface java.util.Map
public java.util.Set directKeySet()
public java.util.Collection values()
values
in interface java.util.Map
public java.util.Collection directValues()
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public java.util.Set directEntrySet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |