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:
MapJavaProxy.RubyHashMap,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 TypeClassDescriptionprivate classprivate classprivate classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classprivate static classrb_hash_equalprivate static final classstatic final classprivate static classprivate static classprivate static classprivate static classstatic classprivate static classstatic classNested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final RubyHash.VisitorWithState<long[]>static final intstatic final intprivate static final RubyHash.VisitorWithState<Block>private static final RubyHash.EntryViewprivate static final RubyHash.EntryViewprivate static final RubyHash.EntryViewprivate static final RubyHash.EntryViewprivate static final RubyHash.VisitorWithState<RubyHash>private static final RubyHash.VisitorWithState<RubyHash>private static final RubyHash.Foundprivate static final RubyHash.VisitorWithState<IRubyObject>private static final RubyHash.VisitorWithState<IRubyObject>private static final RubyHash.VisitorWithState<IRubyObject>private static final RubyHash.VisitorWithState<IRubyObject>private intprivate static final intprivate final RubyHash.RubyHashEntryprivate IRubyObjectprivate static final intprivate static final RubyHash.VisitorWithState<RubyString>private static final RubyHash.VisitorWithState<RubyHash>private static final AtomicIntegerFieldUpdater<RubyHash>private intprivate static final intprivate static final RubyHash.EntryViewstatic final intprivate static final RubyHash.VisitorWithState<MarshalStream>private static final RubyHash.EntryMatchTypeprivate static final RubyHash.EntryMatchTypeprivate static final intprivate static final intprivate static final RubyHash.Mismatchprivate static final booleanprivate static final booleanprivate static final intstatic final int[]static final RubyHash.RubyHashEntryprivate static final intprivate static final RubyHash.VisitorWithState<RubyHash>(package private) static final RubyHash.VisitorWithStateprotected intprivate static final intprivate static final RubyHash.VisitorWithState<RubyArray>private static final RubyHash.VisitorWithState<RubyArray>static final RubyHash.VisitorWithState<RubyArray>private RubyHash.RubyHashEntry[]private intprivate static final RubyHash.EntryViewprivate static final RubyHash.VisitorWithState<Block>private static final RubyHash.VisitorWithState<Block>private static final RubyHash.VisitorWithState<Block>private static final RubyHash.VisitorWithState<Block>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, UNTRUST_F, 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
ConstructorsModifierConstructorDescription(package private)RubyHash(Ruby runtime, Map valueMap, IRubyObject defaultValue) privateprotectedRubyHash(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 TypeMethodDescriptionprivate final voidalloc()private final voidprivate final voidallocFirst(int buckets) <T> booleanany_p(ThreadContext context, IRubyObject[] args, Block block) private IRubyObjectany_p_i(ThreadContext context, Block block) private IRubyObjectany_p_i_fast(ThreadContext context, Block block) private IRubyObjectany_p_p(ThreadContext context, IRubyObject pattern) aref(IRubyObject key) Deprecated.use RubyHash.op_aref insteadaset(IRubyObject key, IRubyObject value) Deprecated.use RubyHash.op_aset insteadassoc(ThreadContext context, IRubyObject obj) private static intbucketIndex(int h, int length) private voiddefault_proc_arity_checkprotected final voidprivate voidvoidclear()compact(ThreadContext context) compact_bang(ThreadContext context) compare(ThreadContext context, RubyHash.VisitorWithState<RubyHash> visitor, IRubyObject other) compare_by_identity(ThreadContext context) compare_by_identity_p(ThreadContext context) private final RaiseExceptionbooleancontainsKey(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(Ruby runtime) 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(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) 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_valueeach19(ThreadContext context, Block block) eachCommon(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.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 voidfastASetCheckString19(Ruby runtime, IRubyObject key, IRubyObject value) Deprecated.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 voidfastASetSmallCheckString19(Ruby runtime, IRubyObject key, IRubyObject value) Deprecated.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) (package private) final RubyHash.RubyHashEntrygetEntry(IRubyObject key) 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) has_key_p(ThreadContext context, IRubyObject key) rb_hash_has_keyhas_value_p(ThreadContext context, IRubyObject expected) rb_hash_has_valuebooleanhash()rb_hash_hashhash(ThreadContext context) private booleanhash_le_ifinal RubyFixnumhash19()Deprecated.private static RubyStringhashKeyString(Ruby runtime, RubyString key) protected final inthashValue(IRubyObject key) private booleanhasValue(ThreadContext context, IRubyObject expected) index(ThreadContext context, IRubyObject expected) rb_hash_indexindex19(ThreadContext context, IRubyObject expected) Deprecated.initialize(IRubyObject[] args, Block block) rb_hash_initializeinitialize_copy(ThreadContext context, IRubyObject other) initialize_copy19(ThreadContext context, IRubyObject other) Deprecated.inspect()rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj.inspect(ThreadContext context) rb_hash_inspectinspect19(ThreadContext context) Deprecated.protected RubyStringinspectHash(ThreadContext context) inspect_hashprivate final RubyHash.RubyHashEntry[]internalCopyTable(RubyHash.RubyHashEntry destHead) private final RubyHash.RubyHashEntryinternalDelete(int hash, RubyHash.EntryMatchType matchType, Object obj) protected RubyHash.RubyHashEntryprotected RubyHash.RubyHashEntryprotected IRubyObjectinternalGet(IRubyObject key) protected RubyHash.RubyHashEntryprivate IRubyObjectinternalIndex(ThreadContext context, IRubyObject expected) protected final IRubyObjectinternalJavaPut(IRubyObject key, IRubyObject value) Deprecated.private booleaninternalKeyExist(int entryHash, IRubyObject entryKey, int hash, IRubyObject key) internalPut(IRubyObject key, IRubyObject value) private voidinternalPut(IRubyObject key, IRubyObject value, boolean checkForExisting) (package private) final booleaninternalPutIfNoKey(IRubyObject key, IRubyObject value) protected IRubyObjectinternalPutNoResize(IRubyObject key, IRubyObject value, boolean checkForExisting) private voidinternalPutSmall(IRubyObject key, IRubyObject value) protected voidinternalPutSmall(IRubyObject key, IRubyObject value, boolean checkForExisting) Deprecated.invert(ThreadContext context) rb_hash_invertprotected booleanIs this object compared by identity or not? Shortcut for doing getFlag(COMPARE_BY_IDENTITY_F).booleanisEmpty()booleanprivate voidprivate voidprivate voidprivate voidprivate <T> voiditeratorVisitAll(ThreadContext context, RubyHash.VisitorWithState<T> visitor, T state) private static intJavaSoftBucketIndex(int h, int length) private final voidprivate static intJavaSoftHashValue(int h) keep_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) 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.merge_bang19(ThreadContext context, IRubyObject other, Block block) Deprecated.voidmodify()rb_hash_modifyprivate static intMRIBucketIndex(int h, int length) private final voidprivate static intMRIHashValue(int h) static 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) rb_hash_asetop_aset19(ThreadContext context, IRubyObject key, IRubyObject value) Deprecated.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_eql19(ThreadContext context, IRubyObject other) Deprecated.op_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) private booleanvoidrassoc(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) 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_replacereplace19(ThreadContext context, IRubyObject other) Deprecated.private final voidresize(int newCapacity) private voidresizeAndAdjustThreshold(RubyHash.RubyHashEntry[] oldTable) select(ThreadContext context, Block block) rb_hash_selectselect_bang(ThreadContext context, Block block) select19(ThreadContext context, Block block) Deprecated.set_default_proc(IRubyObject proc) Deprecated.set_default_proc(ThreadContext context, IRubyObject proc) rb_hash_set_default_procDeprecated.voidsetComparedByIdentity(boolean comparedByIdentity) Sets whether this object is compared by identity or not.voidsetKeywordRestArguments(boolean value) shift(ThreadContext context) rb_hash_shiftprivate static JavaSites.HashSitessites(ThreadContext context) intsize()private static IRubyObjectsize(ThreadContext context, RubyHash recv, IRubyObject[] args) A size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])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_hashfinal IRubyObjectto_s19(ThreadContext context) transform_keys(ThreadContext context, Block block) transform_keys_bang(ThreadContext context, 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) 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.VisitorWithState visitor, T state) private <T> voidvisitLimited(ThreadContext context, RubyHash.VisitorWithState visitor, long size, T state) Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, hashCode, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, defaultToJava, display, dup, ensureInstanceVariablesSettable, eql, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, infectBy, infectBy, initialize, initialize_copy, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, methodsImpl, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal_19, op_match, op_match19, op_not, op_not_equal, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted, tainted_p, testFrozen, testFrozen, to_s, toJava, trust, type, type_deprecated, 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 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 -
KEYWORD_REST_ARGUMENTS_F
public static final int KEYWORD_REST_ARGUMENTS_F -
table
-
size
protected int size -
threshold
private int threshold -
PROCDEFAULT_HASH_F
private static final int PROCDEFAULT_HASH_F -
ifNone
-
MRI_PRIMES
public static final int[] MRI_PRIMES -
JAVASOFT_INITIAL_CAPACITY
private static final int JAVASOFT_INITIAL_CAPACITY- See Also:
-
MRI_INITIAL_CAPACITY
private static final int MRI_INITIAL_CAPACITY -
INITIAL_THRESHOLD
private static final int INITIAL_THRESHOLD- See Also:
-
MAXIMUM_CAPACITY
private static final int MAXIMUM_CAPACITY- See Also:
-
NO_ENTRY
-
generation
private int generation -
head
-
HASH_SIGN_BIT_MASK
private static final int HASH_SIGN_BIT_MASK- See Also:
-
MIN_CAPA
private static final int MIN_CAPA- See Also:
-
ST_DEFAULT_MAX_DENSITY
private static final int ST_DEFAULT_MAX_DENSITY- See Also:
-
MRI_HASH
private static final boolean MRI_HASH- See Also:
-
MRI_HASH_RESIZE
private static final boolean MRI_HASH_RESIZE- See Also:
-
MATCH_KEY
-
MATCH_ENTRY
-
InspectVisitor
-
StoreKeyValueVisitor
-
FindMismatchUsingEqualVisitor
-
FindMismatchUsingEqlVisitor
-
CalculateHashVisitor
-
FOUND
-
FoundIfEqualVisitor
-
iteratorCount
private volatile int iteratorCount -
ITERATOR_UPDATER
-
YieldArrayVisitor
-
YieldKeyValueArrayVisitor
-
YieldValueVisitor
-
YieldKeyVisitor
-
FoundKeyIfEqual
-
StoreKeyVisitor
-
StoreValueVisitor
-
SetValueVisitor
-
MISMATCH
-
DeleteIfVisitor
-
InvertVisitor
-
ReplaceVisitor
-
FoundPairIfEqualKeyVisitor
-
FoundPairIfEqualValueVisitor
-
MarshalDumpVisitor
-
DIRECT_KEY_VIEW
-
KEY_VIEW
-
DIRECT_VALUE_VIEW
-
VALUE_VIEW
-
DIRECT_ENTRY_VIEW
-
ENTRY_VIEW
-
-
Constructor Details
-
RubyHash
-
RubyHash
-
RubyHash
-
RubyHash
-
RubyHash
-
RubyHash
-
RubyHash
protected RubyHash(Ruby runtime, RubyClass metaClass, IRubyObject defaultValue, RubyHash.RubyHashEntry[] initialTable, int threshold) -
RubyHash
RubyHash(Ruby runtime, int buckets, boolean objectSpace) -
RubyHash
-
-
Method Details
-
createHashClass
-
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- 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 -
allocFirst
private final void allocFirst() -
allocFirst
private final void allocFirst(int buckets) -
alloc
private final void alloc() -
JavaSoftHashValue
private static int JavaSoftHashValue(int h) -
JavaSoftBucketIndex
private static int JavaSoftBucketIndex(int h, int length) -
MRIHashValue
private static int MRIHashValue(int h) -
MRIBucketIndex
private static int MRIBucketIndex(int h, int length) -
resize
private final void resize(int newCapacity) -
JavaSoftCheckResize
private final void JavaSoftCheckResize() -
overThreshold
private boolean overThreshold() -
resizeAndAdjustThreshold
-
MRICheckResize
private final void MRICheckResize() -
hashValue
-
bucketIndex
private static int bucketIndex(int h, int length) -
checkResize
private void checkResize() -
checkIterating
protected final void checkIterating() -
internalPut
-
internalPutSmall
-
internalPut
-
internalPutIfNoKey
-
internalJavaPut
Deprecated. -
internalPutNoResize
protected IRubyObject internalPutNoResize(IRubyObject key, IRubyObject value, boolean checkForExisting) -
internalGet
-
internalGetEntry
-
getEntry
-
internalKeyExist
-
internalDelete
-
internalDeleteEntry
-
internalDelete
private final RubyHash.RubyHashEntry internalDelete(int hash, RubyHash.EntryMatchType matchType, Object obj) -
internalCopyTable
-
visitAll
-
visitLimited
private <T> void visitLimited(ThreadContext context, RubyHash.VisitorWithState visitor, long size, T state) -
allSymbols
public <T> boolean allSymbols() -
initialize
rb_hash_initialize -
default_value_get
-
default_value_get
-
default_value_set
rb_hash_set_default -
default_proc
rb_hash_default_proc -
checkDefaultProcArity
default_proc_arity_check -
set_default_proc
rb_hash_set_default_proc -
modify
public void modify()rb_hash_modify -
inspectHash
inspect_hash -
inspect
Description copied from class:RubyBasicObjectrb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject- Returns:
- String
-
inspect
rb_hash_inspect -
inspect19
Deprecated. -
rb_size
rb_hash_size -
size
A size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[]) -
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 -
to_s19
-
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
-
fastASetCheckString
-
fastASetSmallCheckString
-
fastASet
-
fastASetSmall
public final void fastASetSmall(Ruby runtime, IRubyObject key, IRubyObject value, boolean prepareString) -
op_aset
rb_hash_aset -
op_asetForString
-
op_asetSmallForString
-
hashKeyString
-
fastARef
-
compare
public RubyBoolean compare(ThreadContext context, RubyHash.VisitorWithState<RubyHash> visitor, IRubyObject other) -
op_equal
rb_hash_equal- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
op_eql
rb_hash_eql -
op_eql19
Deprecated. -
op_aref
rb_hash_aref -
hash_le
hash_le_i -
op_lt
-
op_le
-
op_gt
-
op_ge
-
hash
rb_hash_hash- Overrides:
hashin classRubyBasicObject
-
hash
-
hash19
Deprecated. -
fetch
rb_hash_fetch -
fetch
-
fetch
-
has_key_p
rb_hash_has_key -
has_key_p
-
hasValue
-
has_value_p
rb_hash_has_value -
iteratorEntry
private void iteratorEntry() -
iteratorExit
private void iteratorExit() -
iteratorEntrySync
private void iteratorEntrySync() -
iteratorExitSync
private void iteratorExitSync() -
iteratorVisitAll
private <T> void iteratorVisitAll(ThreadContext context, RubyHash.VisitorWithState<T> visitor, T state) -
eachCommon
rb_hash_each -
each
-
each19
-
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. -
index
rb_hash_index -
index19
Deprecated. -
key
-
internalIndex
-
keys
rb_hash_keys -
keys
-
values
rb_hash_values -
rb_values
-
shift
rb_hash_shift -
fastDelete
-
delete
rb_hash_delete -
delete
-
select
rb_hash_select -
slice
rb_hash_slice -
select19
Deprecated. -
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 -
merge_bang19
Deprecated. -
merge
Deprecated. -
merge
rb_hash_merge -
initialize_copy
-
initialize_copy19
Deprecated. -
replace
rb_hash_replace -
values_at
rb_hash_values_at -
fetch_values
-
assoc
-
rassoc
-
flatten
-
flatten
-
compact
-
compact_bang
-
compare_by_identity
-
compare_by_identity_p
-
dup
-
rbClone
-
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
-
dig
-
dig
-
dig
-
dig
-
to_proc
-
marshalTo
- Throws:
IOException
-
unmarshalFrom
public static RubyHash unmarshalFrom(UnmarshalStream input, boolean defaultValue) throws IOException - Throws:
IOException
-
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- See Also:
-
keySet
-
directKeySet
-
values
-
directValues
-
entrySet
-
directEntrySet
-
concurrentModification
-
isComparedByIdentity
protected 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?
-
isKeywordRestArguments
public boolean isKeywordRestArguments() -
setKeywordRestArguments
public void setKeywordRestArguments(boolean value) -
op_aset19
Deprecated. -
aset
Deprecated.use RubyHash.op_aset insteadNote: this is included as a compatibility measure for AR-JDBC -
aref
Deprecated.use RubyHash.op_aref insteadNote: this is included as a compatibility measure for Mongrel+JRuby -
sites
-
fastASetCheckString19
@Deprecated public final void fastASetCheckString19(Ruby runtime, IRubyObject key, IRubyObject value) Deprecated. -
fastASetSmallCheckString19
@Deprecated public final void fastASetSmallCheckString19(Ruby runtime, IRubyObject key, IRubyObject value) Deprecated. -
op_aset
Deprecated. -
each_pair
Deprecated. -
each_pairCommon
Deprecated. -
replace19
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. -
set_default_proc20
Deprecated. -
rb_size
Deprecated. -
empty_p
Deprecated. -
rehash
Deprecated. -
to_hash
Deprecated. -
rb_values
Deprecated. -
rb_clear
Deprecated.
-