|
||||||||||
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.
Nested Class Summary | |
---|---|
static class |
RubyHash.Callback
|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Finalizer |
Nested classes/interfaces inherited from interface java.util.Map |
---|
java.util.Map.Entry |
Field Summary | |
---|---|
static byte |
AREF_SWITCHVALUE
|
static byte |
ASET_SWITCHVALUE
|
static long |
collisions
|
static byte |
DEFAULT_SWITCHVALUE
|
static byte |
EMPTY_P_SWITCHVALUE
|
static byte |
EQL_P_SWITCHVALUE
|
static byte |
EQUALEQUAL_SWITCHVALUE
|
static byte |
HASH_SWITCHVALUE
|
static byte |
INSPECT_SWITCHVALUE
|
static byte |
LENGTH_SWITCHVALUE
|
static byte |
NIL_P_SWITCHVALUE
|
static int |
ST_CHECK
|
static int |
ST_CONTINUE
|
static int |
ST_DELETE
|
static int |
ST_STOP
|
static byte |
TO_A_SWITCHVALUE
|
static byte |
TO_HASH_SWITCHVALUE
|
static byte |
TO_S_SWITCHVALUE
|
Fields inherited from class org.jruby.RubyObject |
---|
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR |
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)
rb_hash_aref |
IRubyObject |
aset(IRubyObject key,
IRubyObject value)
rb_hash_aset |
IRubyObject |
callMethod(ThreadContext context,
RubyModule rubyclass,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
RubyHash |
convertToHash()
|
static IRubyObject |
create(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(IRubyObject[] args)
rb_hash_default |
IRubyObject |
default_value_set(IRubyObject defaultValue)
rb_hash_set_default |
RubyHash |
delete_if(Block block)
rb_hash_delete_if |
IRubyObject |
delete(IRubyObject key,
Block block)
rb_hash_delete |
java.util.Set |
directEntrySet()
return an entry set who's entries do not convert their values, faster |
java.util.Set |
directKeySet()
|
java.util.Collection |
directValues()
|
RubyHash |
each_key(Block block)
rb_hash_each_key |
RubyHash |
each_pair(Block block)
rb_hash_each_pair |
RubyHash |
each_value(Block block)
rb_hash_each_value |
RubyHash |
each(Block block)
rb_hash_each |
RubyBoolean |
empty_p()
rb_hash_empty_p |
java.util.Set |
entrySet()
|
IRubyObject |
equal(IRubyObject other)
rb_equal |
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)
|
IRubyObject |
fetch(IRubyObject[] args,
Block block)
rb_hash_fetch |
void |
forEach(RubyHash.Callback callback)
|
java.lang.Object |
get(java.lang.Object key)
|
IRubyObject |
getIfNone()
|
java.lang.Class |
getJavaClass()
RubyMethod getJavaClass. |
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(IRubyObject key)
rb_hash_has_key |
RubyBoolean |
has_value(IRubyObject value)
rb_hash_has_value |
boolean |
hasDefaultProc()
|
IRubyObject |
index(IRubyObject value)
rb_hash_index |
RubyArray |
indices(IRubyObject[] indices)
rb_hash_indexes |
IRubyObject |
initialize(IRubyObject[] args,
Block block)
rb_hash_initialize |
IRubyObject |
inspect()
rb_hash_inspect |
RubyHash |
invert()
rb_hash_invert |
boolean |
isEmpty()
|
RubyArray |
keys()
rb_hash_keys |
java.util.Set |
keySet()
|
static void |
marshalTo(RubyHash hash,
MarshalStream output)
|
RubyHash |
merge(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 |
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(Block block)
rb_hash_reject_bang |
RubyHash |
reject(Block block)
rb_hash_reject |
java.lang.Object |
remove(java.lang.Object key)
|
RubyHash |
replace(IRubyObject other)
rb_hash_replace |
IRubyObject |
select(IRubyObject[] args,
Block block)
rb_hash_select |
IRubyObject |
shift()
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 |
static RubyHash |
unmarshalFrom(UnmarshalStream input,
boolean defaultValue)
|
RubyHash |
update(IRubyObject other,
Block block)
rb_hash_update |
RubyArray |
values_at(IRubyObject[] args)
rb_hash_values_at |
java.util.Collection |
values()
|
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 final byte AREF_SWITCHVALUE
public static final byte ASET_SWITCHVALUE
public static final byte DEFAULT_SWITCHVALUE
public static final byte NIL_P_SWITCHVALUE
public static final byte EQUALEQUAL_SWITCHVALUE
public static final byte EMPTY_P_SWITCHVALUE
public static final byte TO_S_SWITCHVALUE
public static final byte TO_A_SWITCHVALUE
public static final byte HASH_SWITCHVALUE
public static final byte LENGTH_SWITCHVALUE
public static final byte TO_HASH_SWITCHVALUE
public static final byte EQL_P_SWITCHVALUE
public static final byte INSPECT_SWITCHVALUE
public static long collisions
public static final int ST_CONTINUE
public static final int ST_STOP
public static final int ST_DELETE
public static final int ST_CHECK
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 IRubyObject
getNativeTypeIndex
in class RubyObject
public IRubyObject callMethod(ThreadContext context, RubyModule rubyclass, int methodIndex, java.lang.String name, IRubyObject[] args, CallType callType, Block block)
callMethod
in interface IRubyObject
callMethod
in class RubyObject
public static IRubyObject create(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 final void forEach(RubyHash.Callback callback)
public IRubyObject initialize(IRubyObject[] args, Block block)
initialize
in class RubyObject
public IRubyObject default_value_get(IRubyObject[] args)
public IRubyObject default_value_set(IRubyObject defaultValue)
public IRubyObject default_proc()
public void modify()
public IRubyObject inspect()
inspect
in interface IRubyObject
inspect
in class RubyObject
public RubyFixnum rb_size()
public RubyBoolean empty_p()
public RubyArray to_a()
public IRubyObject to_s()
to_s
in class RubyObject
public RubyHash rehash()
public RubyHash to_hash()
public RubyHash convertToHash()
convertToHash
in interface IRubyObject
convertToHash
in class RubyObject
public final void fastASet(IRubyObject key, IRubyObject value)
public IRubyObject aset(IRubyObject key, IRubyObject value)
public final IRubyObject fastARef(IRubyObject key)
public IRubyObject aref(IRubyObject key)
public IRubyObject fetch(IRubyObject[] args, Block block)
public RubyBoolean has_key(IRubyObject key)
public RubyBoolean has_value(IRubyObject value)
public RubyHash each(Block block)
public RubyHash each_pair(Block block)
public RubyHash each_value(Block block)
public RubyHash each_key(Block block)
public RubyArray sort(Block block)
public IRubyObject index(IRubyObject value)
public RubyArray indices(IRubyObject[] indices)
public RubyArray keys()
public RubyArray rb_values()
public IRubyObject equal(IRubyObject other)
RubyObject
equal
in interface IRubyObject
equal
in class RubyObject
public IRubyObject shift()
public IRubyObject delete(IRubyObject key, Block block)
public IRubyObject select(IRubyObject[] args, Block block)
public RubyHash delete_if(Block block)
public RubyHash reject(Block block)
public IRubyObject reject_bang(Block block)
public RubyHash rb_clear()
public RubyHash invert()
public RubyHash update(IRubyObject other, Block block)
public RubyHash merge(IRubyObject other, Block block)
public RubyHash replace(IRubyObject other)
public RubyArray values_at(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()
IRubyObject
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 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()
public boolean equals(java.lang.Object other)
RubyObject
equals
in interface java.util.Map
equals
in class RubyObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |