Logo Search packages:      
Sourcecode: jruby version File versions  Download package

Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Package Functions | Static Package Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

org::jruby::RubyHash Class Reference

Inheritance diagram for org::jruby::RubyHash:
Inheritance graph
[legend]
Collaboration diagram for org::jruby::RubyHash:
Collaboration graph
[legend]

List of all members.

Classes

class  BaseCollection
class  BaseIterator
class  BaseSet
class  ConvertingEntry
class  EntryMatchType
class  EntryView
class  Found
class  FoundKey
class  FoundPair
class  Mismatch
class  RubyHashEntry
class  Visitor
class  VisitorIOException

Public Member Functions

void addFinalizer (IRubyObject f)
IRubyObject anyToString ()
IRubyObject aref (IRubyObject key)
IRubyObject aset (IRubyObject key, IRubyObject value)
String asJavaString ()
IRubyObject assoc (final ThreadContext context, final IRubyObject obj)
RubyString asString ()
void attachToObjectSpace ()
final void callInit (IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject arg)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args)
final IRubyObject callMethod (String name, IRubyObject...args)
final IRubyObject callMethod (String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name, IRubyObject arg)
IRubyObject callSuper (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject checkArrayType ()
final IRubyObject checkCallMethod (ThreadContext context, String name)
IRubyObject checkStringType ()
IRubyObject checkStringType19 ()
void clear ()
RubyBoolean compare (final ThreadContext context, final String method, IRubyObject other, final Set< RecursiveComparator.Pair > seen)
int compareTo (IRubyObject other)
boolean containsKey (Object key)
boolean containsValue (Object value)
RubyArray convertToArray ()
RubyFloat convertToFloat ()
RubyHash convertToHash ()
RubyInteger convertToInteger ()
RubyInteger convertToInteger (int methodIndex, String convertMethod)
RubyInteger convertToInteger (String convertMethod)
RubyString convertToString ()
final IRubyObject convertToType (RubyClass target, int convertMethodIndex)
void copyInstanceVariablesInto (final InstanceVariables other)
void copyInstanceVariablesInto (InstanceVariables other)
void copySpecialInstanceVariables (IRubyObject clone)
synchronized Object dataGetStruct ()
synchronized Object dataGetStructChecked ()
synchronized void dataWrapStruct (Object obj)
IRubyObject default_proc ()
IRubyObject default_value_get (ThreadContext context)
IRubyObject default_value_get (ThreadContext context, IRubyObject arg)
IRubyObject default_value_get (ThreadContext context, IRubyObject[] args)
IRubyObject default_value_set (final IRubyObject defaultValue)
IRubyObject delete (ThreadContext context, IRubyObject key, Block block)
RubyHash delete_if (final ThreadContext context, final Block block)
IRubyObject delete_if19 (final ThreadContext context, final Block block)
Set directEntrySet ()
Set directKeySet ()
Collection directValues ()
IRubyObject display (ThreadContext context, IRubyObject[] args)
IRubyObject dup ()
IRubyObject dup (ThreadContext context)
RubyHash each (final ThreadContext context, final Block block)
IRubyObject each19 (final ThreadContext context, final Block block)
RubyHash each_key (final ThreadContext context, final Block block)
IRubyObject each_key19 (final ThreadContext context, final Block block)
RubyHash each_pair (final ThreadContext context, final Block block)
IRubyObject each_pair19 (final ThreadContext context, final Block block)
RubyHash each_value (final ThreadContext context, final Block block)
IRubyObject each_value19 (final ThreadContext context, final Block block)
RubyBoolean empty_p ()
Set entrySet ()
boolean eql (IRubyObject other)
IRubyObject eql_p (IRubyObject obj)
IRubyObject equal_p (ThreadContext context, IRubyObject obj)
IRubyObject equal_p19 (ThreadContext context, IRubyObject other)
boolean equals (Object other)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, RubyString src, String file, int line)
IRubyObject extend (IRubyObject[] args)
final IRubyObject fastARef (IRubyObject key)
final void fastASet (IRubyObject key, IRubyObject value)
final RubyHash fastASetChained (IRubyObject key, IRubyObject value)
final void fastASetCheckString (Ruby runtime, IRubyObject key, IRubyObject value)
final void fastASetCheckString19 (Ruby runtime, IRubyObject key, IRubyObject value)
final boolean fastDelete (IRubyObject key)
IRubyObject fastGetInstanceVariable (String internedName)
Object fastGetInternalVariable (String internedName)
boolean fastHasInstanceVariable (String internedName)
boolean fastHasInternalVariable (String internedName)
IRubyObject fastSetInstanceVariable (String internedName, IRubyObject value)
void fastSetInternalVariable (String internedName, Object value)
IRubyObject fetch (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject flatten (ThreadContext context)
IRubyObject flatten (ThreadContext context, IRubyObject level)
IRubyObject freeze (ThreadContext context)
RubyBoolean frozen_p (ThreadContext context)
Object get (Object key)
IRubyObject getCompareByIdentity (ThreadContext context)
IRubyObject getCompareByIdentity_p (ThreadContext context)
final boolean getFlag (int flag)
IRubyObject getIfNone ()
IRubyObject getInstanceVariable (String name)
List< Variable< IRubyObject > > getInstanceVariableList ()
List< String > getInstanceVariableNameList ()
InstanceVariables getInstanceVariables ()
Object getInternalVariable (String name)
InternalVariables getInternalVariables ()
Class getJavaClass ()
final RubyClass getMetaClass ()
int getNativeTypeIndex ()
final Ruby getRuntime ()
RubyClass getSingletonClass ()
RubyClass getType ()
Object getVariable (int index)
int getVariableCount ()
List< Variable< Object > > getVariableList ()
List< String > getVariableNameList ()
RubyBoolean has_key_p (IRubyObject key)
RubyBoolean has_value_p (ThreadContext context, IRubyObject expected)
boolean hasDefaultProc ()
RubyFixnum hash ()
RubyFixnum hash19 ()
int hashCode ()
IRubyObject hashyInspect ()
boolean hasInstanceVariable (String name)
boolean hasInternalVariable (String name)
boolean hasVariables ()
IRubyObject id ()
IRubyObject id_deprecated ()
IRubyObject index (ThreadContext context, IRubyObject expected)
IRubyObject index19 (ThreadContext context, IRubyObject expected)
RubyArray indices (ThreadContext context, IRubyObject[] indices)
IRubyObject infectBy (IRubyObject obj)
IRubyObject initialize ()
IRubyObject initialize (IRubyObject[] args, final Block block)
RubyHash initialize_copy (ThreadContext context, IRubyObject other)
IRubyObject initialize_copy (IRubyObject original)
RubyHash initialize_copy19 (ThreadContext context, IRubyObject other)
IRubyObject inspect ()
IRubyObject inspect (ThreadContext context)
IRubyObject instance_eval (ThreadContext context, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject instance_exec (ThreadContext context, IRubyObject[] args, Block block)
RubyBoolean instance_of_p (ThreadContext context, IRubyObject type)
IRubyObject instance_variable_defined_p (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_get (ThreadContext context, IRubyObject name)
IRubyObject instance_variable_set (IRubyObject name, IRubyObject value)
RubyArray instance_variables (ThreadContext context)
RubyHash invert (final ThreadContext context)
boolean isBuiltin (String methodName)
boolean isClass ()
boolean isEmpty ()
final boolean isFalse ()
boolean isFrozen ()
boolean isImmediate ()
boolean isModule ()
final boolean isNil ()
boolean isTaint ()
final boolean isTrue ()
boolean isUntrusted ()
IRubyObject key (ThreadContext context, IRubyObject expected)
RubyArray keys ()
Set keySet ()
RubyBoolean kind_of_p (ThreadContext context, IRubyObject type)
RubyClass makeMetaClass (RubyClass superClass)
RubyHash merge (ThreadContext context, IRubyObject other, Block block)
RubyHash merge_bang (final ThreadContext context, final IRubyObject other, final Block block)
RubyHash merge_bang19 (final ThreadContext context, final IRubyObject other, final Block block)
IRubyObject method (IRubyObject symbol)
IRubyObject methods (ThreadContext context, IRubyObject[] args)
IRubyObject methods (ThreadContext context, IRubyObject[] args, boolean useSymbols)
IRubyObject methods19 (ThreadContext context, IRubyObject[] args)
void modify ()
IRubyObject nil_p (ThreadContext context)
IRubyObject op_aref (ThreadContext context, IRubyObject key)
IRubyObject op_aset (ThreadContext context, IRubyObject key, IRubyObject value)
IRubyObject op_aset (IRubyObject key, IRubyObject value)
IRubyObject op_aset19 (ThreadContext context, IRubyObject key, IRubyObject value)
IRubyObject op_eql19 (final ThreadContext context, IRubyObject other)
IRubyObject op_eqq (ThreadContext context, IRubyObject other)
IRubyObject op_equal (ThreadContext context, IRubyObject obj)
IRubyObject op_equal19 (final ThreadContext context, IRubyObject other)
IRubyObject op_equal_19 (ThreadContext context, IRubyObject obj)
IRubyObject op_match (ThreadContext context, IRubyObject arg)
IRubyObject op_not (ThreadContext context)
IRubyObject op_not_equal (ThreadContext context, IRubyObject other)
IRubyObject op_not_match (ThreadContext context, IRubyObject arg)
IRubyObject private_methods (ThreadContext context, IRubyObject[] args)
IRubyObject private_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods19 (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods19 (ThreadContext context, IRubyObject[] args)
Object put (Object key, Object value)
void putAll (Map map)
IRubyObject rassoc (final ThreadContext context, final IRubyObject obj)
RubyHash rb_clear ()
RubyFixnum rb_size ()
RubyArray rb_values ()
IRubyObject rbClone (ThreadContext context)
IRubyObject rbClone ()
RubyHash rehash ()
RubyHash reject (ThreadContext context, Block block)
IRubyObject reject19 (final ThreadContext context, final Block block)
IRubyObject reject_bang (ThreadContext context, Block block)
IRubyObject reject_bang19 (final ThreadContext context, final Block block)
Object remove (Object key)
IRubyObject remove_instance_variable (ThreadContext context, IRubyObject name, Block block)
void removeFinalizers ()
IRubyObject removeInstanceVariable (String name)
Object removeInternalVariable (String name)
RubyHash replace (final ThreadContext context, IRubyObject other)
RubyHash replace19 (final ThreadContext context, IRubyObject other)
RubyBoolean respond_to_p (IRubyObject mname, IRubyObject includePrivate)
RubyBoolean respond_to_p (IRubyObject mname)
final boolean respondsTo (String name)
 RubyHash (Ruby runtime, IRubyObject defaultValue)
 RubyHash (Ruby runtime, Map valueMap, IRubyObject defaultValue)
 RubyHash (Ruby runtime, RubyClass klass)
 RubyHash (Ruby runtime)
IRubyObject select (final ThreadContext context, final Block block)
IRubyObject select19 (final ThreadContext context, final Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject send (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject send (ThreadContext context, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject send (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject set_default_proc (IRubyObject proc)
void setComparedByIdentity (boolean comparedByIdentity)
final void setFlag (int flag, boolean set)
void setFrozen (boolean frozen)
IRubyObject setInstanceVariable (String name, IRubyObject value)
void setInternalVariable (String name, Object value)
void setMetaClass (RubyClass metaClass)
void setTaint (boolean taint)
void setUntrusted (boolean untrusted)
synchronized void setVariable (int index, Object value)
IRubyObject shift (ThreadContext context)
RubyArray singleton_methods (ThreadContext context, IRubyObject[] args)
RubyArray singleton_methods19 (ThreadContext context, IRubyObject[] args)
RubyArray singletonMethods (ThreadContext context, IRubyObject[] args, boolean asSymbols)
int size ()
IRubyObject sort (ThreadContext context, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject[] args, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, Block block)
void syncVariables (List< Variable< Object >> variables)
IRubyObject taint (ThreadContext context)
RubyBoolean tainted_p (ThreadContext context)
RubyArray to_a ()
RubyHash to_hash ()
IRubyObject to_s (ThreadContext context)
IRubyObject to_s ()
IRubyObject to_s19 (ThreadContext context)
Object toJava (Class target)
String toString ()
IRubyObject trust (ThreadContext context)
RubyClass type ()
RubyClass type_deprecated ()
IRubyObject untaint (ThreadContext context)
IRubyObject untrust (ThreadContext context)
RubyBoolean untrusted_p (ThreadContext context)
Collection values ()
RubyArray values_at (ThreadContext context, IRubyObject[] args)
void visitAll (Visitor visitor)

Static Public Member Functions

static IRubyObject create (ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block)
static RubyClass createBasicObjectClass (Ruby runtime, RubyClass objectClass)
static RubyClass createHashClass (Ruby runtime)
static RubyClass createObjectClass (Ruby runtime, RubyClass objectClass)
static void marshalTo (final RubyHash hash, final MarshalStream output) throws IOException
static final RubyHash newHash (Ruby runtime)
static final RubyHash newHash (Ruby runtime, Map valueMap, IRubyObject defaultValue)
static void puts (Object obj)
static IRubyObject try_convert (ThreadContext context, IRubyObject recv, IRubyObject args)
static RubyHash unmarshalFrom (UnmarshalStream input, boolean defaultValue) throws IOException

Static Public Attributes

static final int ALL_F = -1
static long collisions = 0
static final int COMPARE_BY_IDENTITY_F = (1<<(FL_USHIFT+8))
static final int FALSE_F = 1 << 0
static final int FL_USHIFT = 5
static final int FROZEN_F = 1 << 2
static final IRubyObject NEVER = new RubyBasicObject()
static final int NIL_F = 1 << 1
static final IRubyObject[] NULL_ARRAY = new IRubyObject[0]
static final ObjectAllocator OBJECT_ALLOCATOR
static final int TAINTED_F = 1 << 3
static final IRubyObject UNDEF = new RubyBasicObject()
static final int UNTRUSTED_F = 1 << 4
static final int USER0_F = (1<<(FL_USHIFT+0))
static final int USER1_F = (1<<(FL_USHIFT+1))
static final int USER2_F = (1<<(FL_USHIFT+2))
static final int USER3_F = (1<<(FL_USHIFT+3))
static final int USER4_F = (1<<(FL_USHIFT+4))
static final int USER5_F = (1<<(FL_USHIFT+5))
static final int USER6_F = (1<<(FL_USHIFT+6))
static final int USER7_F = (1<<(FL_USHIFT+7))

Protected Member Functions

void checkFrozen ()
final void ensureInstanceVariablesSettable ()
synchronized long getObjectId ()
RubyClass getSingletonClassClone ()
synchronized long initObjectId (RubyClass.VariableAccessor objectIdAccessor)
int inspectHashCode ()
boolean isComparedByIdentity ()
void taint (Ruby runtime)
final void testFrozen (String message)
final void testFrozen ()
String validateInstanceVariable (String name)
boolean variableTableContains (String name)
boolean variableTableFastContains (String internedName)
Object variableTableFastFetch (String internedName)
Object variableTableFastStore (String internedName, Object value)
Object variableTableFetch (String name)
Object variableTableRemove (String name)
Object variableTableStore (String name, Object value)
void variableTableSync (List< Variable< Object >> vars)

Static Protected Member Functions

static boolean eqlInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)
static boolean equalInternal (final ThreadContext context, final IRubyObject that, final IRubyObject other)

Protected Attributes

int flags
transient RubyClass metaClass

Static Protected Attributes

static final String ERR_INSECURE_SET_INST_VAR = "Insecure: can't modify instance variable"

Package Functions

 [instance initializer]
IRubyObject checkIntegerType (Ruby runtime, IRubyObject obj, String method)
final RubyBasicObject infectBy (int tuFlags)
final RubyBasicObject infectBy (RubyBasicObject obj)
 RubyHash (Ruby runtime, boolean objectSpace)

Static Package Functions

static RubyString inspect (ThreadContext context, IRubyObject object)

Private Member Functions

final void alloc ()
void checkDefaultProcArity (IRubyObject proc)
void checkResize ()
final RaiseException concurrentModification ()
boolean hasValue (final ThreadContext context, final IRubyObject expected)
IRubyObject inspectHash (final ThreadContext context)
final RubyHashEntry[] internalCopyTable (RubyHashEntry destHead)
final RubyHashEntry internalDelete (final int hash, final EntryMatchType matchType, final Object obj)
final RubyHashEntry internalDelete (final IRubyObject key)
final RubyHashEntry internalDeleteEntry (final RubyHashEntry entry)
final IRubyObject internalGet (IRubyObject key)
final RubyHashEntry internalGetEntry (IRubyObject key)
IRubyObject internalIndex (final ThreadContext context, final IRubyObject expected)
boolean internalKeyExist (RubyHashEntry entry, int hash, IRubyObject key)
final void internalPut (final IRubyObject key, final IRubyObject value)
final void internalPut (final IRubyObject key, final IRubyObject value, final boolean checkForExisting)
void iteratorEntry ()
void iteratorExit ()
void iteratorVisitAll (Visitor visitor)
final void JavaSoftCheckResize ()
final void MRICheckResize ()
void op_asetForString (Ruby runtime, RubyString key, IRubyObject value)
boolean overThreshold ()
RubyHash replaceCommon (final ThreadContext context, IRubyObject other, Visitor visitor)
RubyHash replaceCommon19 (final ThreadContext context, IRubyObject other, Visitor visitor)
final void resize (int newCapacity)
void resizeAndAdjustThreshold (RubyHashEntry[] oldTable)
 RubyHash (Ruby runtime, RubyClass klass, RubyHash other)

Static Private Member Functions

static int bucketIndex (final int h, final int length)
static int hashValue (final int h)
static int JavaSoftBucketIndex (final int h, final int length)
static int JavaSoftHashValue (int h)
static int MRIBucketIndex (final int h, final int length)
static int MRIHashValue (int h)

Private Attributes

final EntryView DIRECT_ENTRY_VIEW
final EntryView ENTRY_VIEW
int generation = 0
final RubyHashEntry head = new RubyHashEntry()
IRubyObject ifNone
AtomicInteger iteratorCount = new AtomicInteger(0)
int size = 0
RubyHashEntry[] table
int threshold
final EntryView VALUE_VIEW

Static Private Attributes

static final EntryView DIRECT_KEY_VIEW
static final EntryView DIRECT_VALUE_VIEW
static final Found FOUND = new Found()
static final ObjectAllocator HASH_ALLOCATOR
static final int HASH_SIGN_BIT_MASK = ~(1 << 31)
static final int INITIAL_THRESHOLD = JAVASOFT_INITIAL_CAPACITY - (JAVASOFT_INITIAL_CAPACITY >> 2)
static final int JAVASOFT_INITIAL_CAPACITY = 8
static final EntryView KEY_VIEW
static final EntryMatchType MATCH_ENTRY
static final EntryMatchType MATCH_KEY
static final int MAXIMUM_CAPACITY = 1 << 30
static final int MIN_CAPA = 8
static final boolean MRI_HASH = true
static final boolean MRI_HASH_RESIZE = true
static final int MRI_INITIAL_CAPACITY = MRI_PRIMES[0]
static final int MRI_PRIMES []
static final RubyHashEntry NO_ENTRY = new RubyHashEntry()
static final int PROCDEFAULT_HASH_F = 1 << 10
static final int ST_DEFAULT_MAX_DENSITY = 5

Detailed Description

Implementation of the Hash class.

Concurrency: no synchronization is required among readers, but all users must synchronize externally with writers.

Definition at line 108 of file RubyHash.java.


The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index