Package org.jruby
Class RubyHash
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyHash
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,Map,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
- Direct Known Subclasses:
RubyGlobal.StringOnlyRubyHash,RubySet.DivideTSortHash
Implementation of the Hash class.
Concurrency: no synchronization is required among readers, but
all users must synchronize externally with writers.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic classstatic classstatic interfaceNested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int[]static final RubyHash.RubyHashEntrystatic final intprotected intstatic final RubyHash.VisitorWithState<RubyArray> Fields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionRubyHash(Ruby runtime, Map valueMap, IRubyObject defaultValue) protectedRubyHash(Ruby runtime, RubyClass metaClass, IRubyObject defaultValue, RubyHash.RubyHashEntry[] initialTable, int threshold) RubyHash(Ruby runtime, IRubyObject defaultValue) RubyHash(Ruby runtime, IRubyObject defaultValue, int buckets) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(ThreadContext context, RubyHash otherHash) <T> booleanany_p(ThreadContext context, Block block) any_p(ThreadContext context, IRubyObject[] args, Block block) Deprecated.any_p(ThreadContext context, IRubyObject pattern, Block block) protected IRubyObjectany_p_i(ThreadContext context, Block block) protected IRubyObjectany_p_i_fast(ThreadContext context, Block block) protected IRubyObjectany_p_p(ThreadContext context, IRubyObject pattern) protected voidappendAssociation(boolean keyIsSymbol, ByteList bytes) Append appropriate characters to indicate association (": " vs " => ").aref(IRubyObject key) Deprecated, for removal: This API element is subject to removal in a future version.use RubyHash.op_aref insteadaset(IRubyObject key, IRubyObject value) Deprecated, for removal: This API element is subject to removal in a future version.use RubyHash.op_aset insteadassoc(ThreadContext context, IRubyObject obj) protected final voidvoidclear()compact(ThreadContext context) compact_bang(ThreadContext context) compare(ThreadContext context, RubyHash.VisitorWithState<RubyHash> visitor, IRubyObject other, boolean eql) compare_by_identity(ThreadContext context) compare_by_identity_p(ThreadContext context) booleancontainsKey(Object key) booleancontainsValue(Object value) Tries to convert this object to a Ruby Hash using the "to_hash" method.static IRubyObjectcreate(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) rb_hash_s_createstatic RubyClasscreateHashClass(ThreadContext context, RubyClass Object, RubyModule Enumerable) deconstruct_keys(ThreadContext context, IRubyObject _arg1) Deprecated.default_proc(ThreadContext context) rb_hash_default_procdefault_value_get(ThreadContext context) default_value_get(ThreadContext context, IRubyObject arg) default_value_get(ThreadContext context, IRubyObject[] args) Deprecated.default_value_set(IRubyObject defaultValue) Deprecated.default_value_set(ThreadContext context, IRubyObject defaultValue) rb_hash_set_defaultdelete(IRubyObject key) Delete entry or null.delete(ThreadContext context, IRubyObject key) delete(ThreadContext context, IRubyObject key, Block block) rb_hash_deletedelete_if(ThreadContext context, Block block) delete_ifInternal(ThreadContext context, Block block) rb_hash_delete_ifdig(ThreadContext context, IRubyObject arg0) dig(ThreadContext context, IRubyObject[] args) dig(ThreadContext context, IRubyObject arg0, IRubyObject arg1) dig(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) dup(ThreadContext context) RubyMethod dup.dupFast(ThreadContext context) A lightweight dup for internal use that does not dispatch to initialize_copy nor rehash the keys.each(ThreadContext context, Block block) each_key(ThreadContext context, Block block) each_keyCommon(ThreadContext context, Block block) rb_hash_each_keyeach_pair(ThreadContext context, Block block) Deprecated.each_pairCommon(ThreadContext context, Block block) rb_hash_each_paireach_pairCommon(ThreadContext context, Block block, boolean oneNine) Deprecated.each_value(ThreadContext context, Block block) each_valueCommon(ThreadContext context, Block block) rb_hash_each_valueeachCommon(ThreadContext context, Block block) rb_hash_eachempty_p()Deprecated.empty_p(ThreadContext context) rb_hash_empty_pentrySet()booleanThis override does not do a "checked" dispatch.except(ThreadContext context, IRubyObject[] keys) final IRubyObjectfastARef(IRubyObject key) final voidfastASet(Ruby runtime, IRubyObject key, IRubyObject value, boolean prepareString) final voidfastASet(IRubyObject key, IRubyObject value) final voidfastASetCheckString(Ruby runtime, IRubyObject key, IRubyObject value) final voidfastASetSmall(Ruby runtime, IRubyObject key, IRubyObject value, boolean prepareString) final voidfastASetSmall(IRubyObject key, IRubyObject value) final voidfastASetSmallCheckString(Ruby runtime, IRubyObject key, IRubyObject value) final voidfastASetSmallPair(ThreadContext context, IRubyObject _pair) final booleanfastDelete(IRubyObject key) fetch(ThreadContext context, IRubyObject[] args, Block block) rb_hash_fetchfetch(ThreadContext context, IRubyObject key, Block block) fetch(ThreadContext context, IRubyObject key, IRubyObject _default, Block block) fetch_values(ThreadContext context, IRubyObject[] args, Block block) flatten(ThreadContext context) flatten(ThreadContext context, IRubyObject level) Will return the Java interface that most closely can represent this object, when working through Java integration translations.This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.has_key_p(IRubyObject key) Deprecated.has_key_p(ThreadContext context, IRubyObject key) rb_hash_has_keyhas_value_p(ThreadContext context, IRubyObject expected) rb_hash_has_valuebooleanhash(ThreadContext context) Will return the hash code of this object.protected final inthashValue(IRubyObject key) booleanhasKey(IRubyObject key) A Java API to test the presence of a (Ruby) key in the Hashinitialize(IRubyObject[] args, Block block) Deprecated.initialize(ThreadContext context, Block block) rb_hash_initializeinitialize(ThreadContext context, IRubyObject _default, Block block) initialize(ThreadContext context, IRubyObject _default, IRubyObject hash, Block block) initialize_copy(ThreadContext context, IRubyObject other) Initializes this object as a copy of the original, that is the parameter to this object.inspect(ThreadContext context) rb_hash_inspectprotected RubyStringinspectHash(ThreadContext context) inspect_hashprotected RubyHash.RubyHashEntryprotected RubyHash.RubyHashEntryprotected IRubyObjectinternalGet(IRubyObject key) protected RubyHash.RubyHashEntryprotected final IRubyObjectinternalJavaPut(IRubyObject key, IRubyObject value) Deprecated.internalPut(IRubyObject key, IRubyObject value) protected IRubyObjectinternalPutNoResize(IRubyObject key, IRubyObject value, boolean checkForExisting) protected voidinternalPutSmall(IRubyObject key, IRubyObject value, boolean checkForExisting) Deprecated.invert(ThreadContext context) rb_hash_invertbooleanIs this object compared by identity or not? Shortcut for doing getFlag(COMPARE_BY_IDENTITY_F).booleanisEmpty()booleankeep_if(ThreadContext context, Block block) booleankeep_ifCommon(ThreadContext context, Block block) key(ThreadContext context, IRubyObject expected) final RubyArraykeys()keys(ThreadContext context) rb_hash_keyskeySet()static voidmarshalTo(RubyHash hash, MarshalStream output) Deprecated, for removal: This API element is subject to removal in a future version.static voidmarshalTo(ThreadContext context, RubyOutputStream out, RubyHash hash, MarshalDumper output) merge(ThreadContext context, IRubyObject[] others, Block block) rb_hash_mergemerge(ThreadContext context, IRubyObject other, Block block) Deprecated.merge_bang(ThreadContext context, IRubyObject[] others, Block block) rb_hash_updatemerge_bang(ThreadContext context, IRubyObject other, Block block) Deprecated.voidmodify()rb_hash_modifystatic final RubyHashrb_hash_newstatic final RubyHashnewHash(Ruby runtime, Map valueMap, IRubyObject defaultValue) rb_hash_newstatic RubyHashnewHash(Ruby runtime, IRubyObject key, IRubyObject value) static RubyHashnewKwargs(Ruby runtime, String key, IRubyObject value) static final RubyHashnewSmallHash(Ruby runtime) rb_hash_newop_aref(ThreadContext context, IRubyObject key) rb_hash_arefop_aset(IRubyObject key, IRubyObject value) Deprecated.op_aset(ThreadContext context, IRubyObject key, IRubyObject value) Set a key/value pair into this hash.protected voidop_asetForString(Ruby runtime, RubyString key, IRubyObject value) protected voidop_asetSmallForString(Ruby runtime, RubyString key, IRubyObject value) op_eql(ThreadContext context, IRubyObject other) rb_hash_eqlop_equal(ThreadContext context, IRubyObject other) rb_hash_equalop_ge(ThreadContext context, IRubyObject other) op_gt(ThreadContext context, IRubyObject other) op_le(ThreadContext context, IRubyObject other) op_lt(ThreadContext context, IRubyObject other) voidrassoc(ThreadContext context, IRubyObject obj) rb_clear()Deprecated.rb_clear(ThreadContext context) rb_hash_clearrb_size()Deprecated.rb_size(ThreadContext context) rb_hash_sizefinal RubyArrayDeprecated.final RubyArrayrb_values(ThreadContext context) rbClone(ThreadContext context) rbClone(ThreadContext context, IRubyObject opts) rehash()Deprecated.rehash(ThreadContext context) rb_hash_rehashreject(ThreadContext context, Block block) reject_bang(ThreadContext context, Block block) reject_bangInternal(ThreadContext context, Block block) rb_hash_reject_bangrejectInternal(ThreadContext context, Block block) rb_hash_rejectreplace(ThreadContext context, IRubyObject other) rb_hash_replaceprotected voidreplaceExternally(ThreadContext context, RubyHash otherHash) protected voidreplaceWith(ThreadContext context, RubyHash otherHash) static IRubyObjectruby2_keywords_hash(ThreadContext context, IRubyObject _self, IRubyObject arg) static IRubyObjectruby2_keywords_hash_p(ThreadContext context, IRubyObject _self, IRubyObject arg) select(ThreadContext context, Block block) rb_hash_selectselect_bang(ThreadContext context, Block block) set_default_proc(IRubyObject proc) Deprecated.set_default_proc(ThreadContext context, IRubyObject proc) rb_hash_set_default_procvoidsetComparedByIdentity(boolean comparedByIdentity) Sets whether this object is compared by identity or not.voidsetRuby2KeywordHash(boolean value) shift(ThreadContext context) rb_hash_shiftintsize()slice(ThreadContext context, IRubyObject[] args) rb_hash_slicesort(ThreadContext context, Block block) Deprecated.to_a()Deprecated.to_a(ThreadContext context) rb_hash_to_ato_h(ThreadContext context) Deprecated.to_h(ThreadContext context, Block block) protected RubyHashto_h_block(ThreadContext context, Block block) to_hash()Deprecated.to_hash(ThreadContext context) rb_hash_to_hashto_proc(ThreadContext context) to_s(ThreadContext context) rb_hash_to_s & to_s_hashtransform_keys(ThreadContext context, IRubyObject[] args, Block block) transform_keys_bang(ThreadContext context, IRubyObject[] args, Block block) transform_values(ThreadContext context, Block block) transform_values_bang(ThreadContext context, Block block) static IRubyObjecttry_convert(ThreadContext context, IRubyObject recv, IRubyObject args) static RubyHashunmarshalFrom(UnmarshalStream input, boolean defaultValue) Deprecated, for removal: This API element is subject to removal in a future version.static RubyHashunmarshalFrom(ThreadContext context, RubyInputStream in, MarshalLoader input, boolean defaultValue) values()values(ThreadContext context) rb_hash_valuesvalues_at(ThreadContext context, IRubyObject[] args) rb_hash_values_atfinal voidvisitAll(RubyHash.Visitor visitor) Deprecated.<T> voidvisitAll(ThreadContext context, RubyHash.VisitorWithStateI visitor) <T> voidvisitAll(ThreadContext context, RubyHash.VisitorWithState visitor, T state) Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, finishObjectClass, hashCode, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, compareTo, convertToArray, convertToFloat, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dup, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, eql_p, equal_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_match, op_not, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, singletonClass, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_s, toJava, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, marshalLiveVariablesMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
DEFAULT_INSPECT_STR_SIZE
public static final int DEFAULT_INSPECT_STR_SIZE- See Also:
-
COMPARE_BY_IDENTITY_F
public static final int COMPARE_BY_IDENTITY_F -
RUBY2_KEYWORD_F
public static final int RUBY2_KEYWORD_F -
size
protected int size -
MRI_PRIMES
public static final int[] MRI_PRIMES -
NO_ENTRY
-
StoreValueVisitor
-
-
Constructor Details
-
RubyHash
-
RubyHash
-
RubyHash
-
RubyHash
-
RubyHash
-
RubyHash
protected RubyHash(Ruby runtime, RubyClass metaClass, IRubyObject defaultValue, RubyHash.RubyHashEntry[] initialTable, int threshold) -
RubyHash
-
-
Method Details
-
createHashClass
public static RubyClass createHashClass(ThreadContext context, RubyClass Object, RubyModule Enumerable) -
getNativeClassIndex
Description copied from class:RubyObjectThis is overridden in the other concrete Java builtins to provide a fast way to determine what type they are. Will generally return a value from org.jruby.runtime.ClassIndex- Specified by:
getNativeClassIndexin interfaceCoreObjectType- Overrides:
getNativeClassIndexin classRubyObject- Returns:
- the ClassIndex of the native type this object was constructed from
- See Also:
-
create
public static IRubyObject create(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) rb_hash_s_create -
try_convert
-
newHash
rb_hash_new -
newSmallHash
rb_hash_new -
newKwargs
-
newHash
-
newHash
rb_hash_new -
hashValue
-
checkIterating
protected final void checkIterating() -
internalPut
-
internalJavaPut
Deprecated. -
internalPutNoResize
protected IRubyObject internalPutNoResize(IRubyObject key, IRubyObject value, boolean checkForExisting) -
internalGet
-
internalGetEntry
-
internalDelete
-
internalDeleteEntry
-
visitAll
-
visitAll
-
allSymbols
public <T> boolean allSymbols() -
initialize
rb_hash_initialize -
initialize
-
initialize
public IRubyObject initialize(ThreadContext context, IRubyObject _default, IRubyObject hash, Block block) -
default_value_get
-
default_value_get
-
default_value_set
rb_hash_set_default -
default_proc
rb_hash_default_proc -
set_default_proc
rb_hash_set_default_proc -
modify
public void modify()rb_hash_modify -
inspectHash
inspect_hash -
appendAssociation
Append appropriate characters to indicate association (": " vs " => ").- Parameters:
keyIsSymbol- is the key a symbolbytes- buffer to which to append
-
inspect
rb_hash_inspect- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject
-
rb_size
rb_hash_size -
empty_p
rb_hash_empty_p -
to_a
rb_hash_to_a- Overrides:
to_ain classRubyBasicObject
-
to_s
rb_hash_to_s & to_s_hash- Overrides:
to_sin classRubyBasicObject
-
rehash
rb_hash_rehash -
to_hash
rb_hash_to_hash -
to_h
Deprecated. -
to_h
-
to_h_block
-
convertToHash
Description copied from class:RubyBasicObjectTries to convert this object to a Ruby Hash using the "to_hash" method.- Specified by:
convertToHashin interfaceIRubyObject- Overrides:
convertToHashin classRubyBasicObject- Returns:
- hash representation of this
-
fastASet
-
fastASetSmall
-
fastASetSmallPair
-
fastASetCheckString
-
fastASetSmallCheckString
-
fastASet
-
fastASetSmall
public final void fastASetSmall(Ruby runtime, IRubyObject key, IRubyObject value, boolean prepareString) -
op_aset
Set a key/value pair into this hash.- Parameters:
context- the current thread contextkey- the keyvalue- the value- Returns:
- the value set
-
op_asetForString
-
op_asetSmallForString
-
fastARef
-
compare
public RubyBoolean compare(ThreadContext context, RubyHash.VisitorWithState<RubyHash> visitor, IRubyObject other, boolean eql) -
op_equal
rb_hash_equal- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
op_eql
rb_hash_eql -
op_aref
rb_hash_aref -
op_lt
-
op_le
-
op_gt
-
op_ge
-
hash
Description copied from class:RubyBasicObjectWill return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.- Overrides:
hashin classRubyBasicObject- Parameters:
context- the current thread context- Returns:
- the hash value
-
fetch
rb_hash_fetch -
except
-
fetch
-
fetch
-
has_key_p
rb_hash_has_key -
has_key_p
Deprecated. -
hasKey
A Java API to test the presence of a (Ruby) key in the Hash- Parameters:
key- the native (Ruby) key- Returns:
- true if the hash contains the provided key
-
has_value_p
rb_hash_has_value -
eachCommon
rb_hash_each -
each
-
each_pairCommon
rb_hash_each_pair -
each_valueCommon
rb_hash_each_value -
each_value
-
each_keyCommon
rb_hash_each_key -
each_key
-
transform_keys
-
transform_values
-
transform_keys_bang
-
transform_values_bang
-
select_bang
-
keep_if
-
keep_ifCommon
-
sort
Deprecated. -
key
-
keys
rb_hash_keys -
keys
-
values
rb_hash_values -
rb_values
-
shift
rb_hash_shift -
fastDelete
-
delete
rb_hash_delete -
delete
Delete entry or null. -
delete
-
select
rb_hash_select -
slice
rb_hash_slice -
delete_ifInternal
rb_hash_delete_if -
delete_if
-
rejectInternal
rb_hash_reject -
reject
-
reject_bangInternal
rb_hash_reject_bang -
reject_bang
-
rb_clear
rb_hash_clear -
invert
rb_hash_invert -
merge_bang
Deprecated. -
merge_bang
rb_hash_update -
addAll
-
merge
Deprecated. -
merge
rb_hash_merge -
initialize_copy
Description copied from class:RubyBasicObjectInitializes this object as a copy of the original, that is the parameter to this object. Will make sure that the argument actually has the same real class as this object. It shouldn't be possible to initialize an object with something totally different.- Overrides:
initialize_copyin classRubyBasicObject- Parameters:
context- the thread contextother- the original- Returns:
- a copy unless the same thing
-
replace
rb_hash_replace -
replaceWith
-
replaceExternally
-
values_at
rb_hash_values_at -
fetch_values
-
assoc
-
rassoc
-
flatten
-
flatten
-
compact
-
compact_bang
-
compare_by_identity
-
compare_by_identity_p
-
dup
Description copied from interface:IRubyObjectRubyMethod dup.- Specified by:
dupin interfaceIRubyObject- Parameters:
context- the thread context- Returns:
- a dup-ed object
-
rbClone
- Overrides:
rbClonein classRubyBasicObject
-
rbClone
-
any_p
-
any_p
-
any_p_i
-
any_p_i_fast
-
any_p_p
-
dupFast
A lightweight dup for internal use that does not dispatch to initialize_copy nor rehash the keys. Intended for use in dup'ing keyword args for processing.- Parameters:
context-- Returns:
-
hasDefaultProc
public boolean hasDefaultProc() -
getIfNone
-
deconstruct_keys
-
dig
-
dig
-
dig
-
dig
-
to_proc
-
ruby2_keywords_hash
public static IRubyObject ruby2_keywords_hash(ThreadContext context, IRubyObject _self, IRubyObject arg) -
ruby2_keywords_hash_p
public static IRubyObject ruby2_keywords_hash_p(ThreadContext context, IRubyObject _self, IRubyObject arg) -
marshalTo
@Deprecated(since="10.0", forRemoval=true) public static void marshalTo(RubyHash hash, MarshalStream output) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
marshalTo
public static void marshalTo(ThreadContext context, RubyOutputStream out, RubyHash hash, MarshalDumper output) -
unmarshalFrom
@Deprecated(since="10.0", forRemoval=true) public static RubyHash unmarshalFrom(UnmarshalStream input, boolean defaultValue) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
unmarshalFrom
public static RubyHash unmarshalFrom(ThreadContext context, RubyInputStream in, MarshalLoader input, boolean defaultValue) -
getJavaClass
Description copied from class:RubyBasicObjectWill return the Java interface that most closely can represent this object, when working through Java integration translations.- Specified by:
getJavaClassin interfaceIRubyObject- Overrides:
getJavaClassin classRubyBasicObject- Returns:
- the true Java class of this (Ruby) object
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsKey
- Specified by:
containsKeyin interfaceMap
-
containsValue
- Specified by:
containsValuein interfaceMap
-
get
-
put
-
remove
-
putAll
-
clear
public void clear() -
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Specified by:
equalsin interfaceMap- Overrides:
equalsin classRubyObject- Parameters:
other- object to compare- Returns:
- true if equals
- See Also:
-
keySet
-
directKeySet
-
values
-
directValues
-
entrySet
-
directEntrySet
-
isComparedByIdentity
public boolean isComparedByIdentity()Is this object compared by identity or not? Shortcut for doing getFlag(COMPARE_BY_IDENTITY_F).- Returns:
- true if this object is compared by identity, false otherwise
-
setComparedByIdentity
public void setComparedByIdentity(boolean comparedByIdentity) Sets whether this object is compared by identity or not. Shortcut for doing setFlag(COMPARE_BY_IDENTITY_F, frozen).- Parameters:
comparedByIdentity- should this object be compared by identity?
-
isRuby2KeywordHash
public boolean isRuby2KeywordHash() -
setRuby2KeywordHash
public void setRuby2KeywordHash(boolean value) -
aset
Deprecated, for removal: This API element is subject to removal in a future version.use RubyHash.op_aset insteadNote: this is included as a compatibility measure for AR-JDBC -
aref
Deprecated, for removal: This API element is subject to removal in a future version.use RubyHash.op_aref insteadNote: this is included as a compatibility measure for Mongrel+JRuby -
op_aset
Deprecated. -
each_pair
Deprecated. -
each_pairCommon
Deprecated. -
visitAll
Deprecated. -
default_value_get
Deprecated.rb_hash_default -
internalPutSmall
@Deprecated protected void internalPutSmall(IRubyObject key, IRubyObject value, boolean checkForExisting) Deprecated. -
to_a
Deprecated.- Overrides:
to_ain classRubyBasicObject
-
default_value_set
Deprecated. -
default_proc
Deprecated. -
set_default_proc
Deprecated. -
rb_size
Deprecated. -
empty_p
Deprecated. -
rehash
Deprecated. -
to_hash
Deprecated. -
rb_values
Deprecated. -
rb_clear
Deprecated. -
any_p
Deprecated. -
initialize
Deprecated.
-