Logo Search packages:      
Sourcecode: jruby1.1 version File versions

org::jruby::RubyArray Class Reference

Inheritance diagram for org::jruby::RubyArray:

org::jruby::RubyObject org::jruby::runtime::builtin::IRubyObject org::jruby::runtime::builtin::InstanceVariables org::jruby::runtime::builtin::InternalVariables

List of all members.


Detailed Description

The implementation of the built-in class Array in Ruby.

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

Definition at line 73 of file RubyArray.java.


Public Member Functions

void add (int index, Object element)
boolean add (Object element)
boolean addAll (int index, Collection c)
boolean addAll (Collection c)
void addFinalizer (IRubyObject finalizer)
IRubyObject anyToString ()
RubyArray append (IRubyObject item)
IRubyObject aref (IRubyObject arg0, IRubyObject arg1)
IRubyObject aref (IRubyObject arg0)
IRubyObject aref (IRubyObject[] args)
final RubyArray aryDup ()
IRubyObject as (Class javaClass)
IRubyObject aset (IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
IRubyObject aset (IRubyObject arg0, IRubyObject arg1)
IRubyObject aset (IRubyObject[] args)
String asJavaString ()
IRubyObject assoc (ThreadContext context, IRubyObject key)
RubyString asString ()
IRubyObject at (IRubyObject pos)
void attachToObjectSpace ()
final void callInit (IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name, IRubyObject arg)
final IRubyObject callMethod (ThreadContext context, int methodIndex, String name)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args, Block block)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject[] args)
final IRubyObject callMethod (ThreadContext context, String name, IRubyObject arg)
final IRubyObject callMethod (ThreadContext context, String name)
IRubyObject callSuper (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject checkArrayType ()
IRubyObject checkStringType ()
void clear ()
RubyArray collect (ThreadContext context, Block block)
RubyArray collect_bang (ThreadContext context, Block block)
IRubyObject compact ()
IRubyObject compact_bang ()
RubyArray concat (IRubyObject obj)
boolean contains (Object element)
boolean containsAll (Collection c)
RubyArray convertToArray ()
RubyFloat convertToFloat ()
RubyHash convertToHash ()
RubyInteger convertToInteger (int convertMethodIndex, String convertMethod)
RubyInteger convertToInteger ()
RubyString convertToString ()
final IRubyObject convertToType (RubyClass target, int convertMethodIndex)
synchronized Object dataGetStruct ()
synchronized void dataWrapStruct (Object obj)
IRubyObject delete (ThreadContext context, IRubyObject item, Block block)
IRubyObject delete_at (IRubyObject obj)
IRubyObject delete_if (ThreadContext context, Block block)
IRubyObject display (ThreadContext context, IRubyObject[] args)
IRubyObject dup ()
IRubyObject each (ThreadContext context, Block block)
IRubyObject each_index (ThreadContext context, Block block)
final IRubyObject eltInternal (int offset)
final IRubyObject eltInternalSet (int offset, IRubyObject item)
IRubyObject empty_p ()
final IRubyObject entry (int offset)
final IRubyObject entry (long offset)
boolean eql (IRubyObject other)
IRubyObject eql_p (IRubyObject obj)
RubyBoolean eql_p (ThreadContext context, IRubyObject obj)
IRubyObject equal_p (ThreadContext context, IRubyObject obj)
boolean equals (Object other)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, RubyString src, String file, int line)
IRubyObject evalUnder (final ThreadContext context, RubyModule under, IRubyObject src, IRubyObject file, IRubyObject line)
IRubyObject extend (IRubyObject[] args)
IRubyObject fastGetInstanceVariable (String internedName)
IRubyObject fastGetInternalVariable (String internedName)
boolean fastHasInstanceVariable (String internedName)
boolean fastHasInternalVariable (String internedName)
IRubyObject fastSetInstanceVariable (String internedName, IRubyObject value)
void fastSetInternalVariable (String internedName, IRubyObject value)
IRubyObject fetch (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject fetch (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject fetch (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject fill (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject first (IRubyObject arg0)
IRubyObject first ()
IRubyObject first (IRubyObject[] args)
IRubyObject flatten (ThreadContext context)
IRubyObject flatten_bang (ThreadContext context)
IRubyObject freeze (ThreadContext context)
RubyBoolean frozen_p (ThreadContext context)
Object get (int index)
final boolean getFlag (int flag)
IRubyObject getInstanceVariable (String name)
List< Variable< IRubyObject > > getInstanceVariableList ()
List< String > getInstanceVariableNameList ()
InstanceVariables getInstanceVariables ()
IRubyObject getInternalVariable (String name)
List< Variable< IRubyObject > > getInternalVariableList ()
InternalVariables getInternalVariables ()
Class getJavaClass ()
int getLength ()
List getList ()
final RubyClass getMetaClass ()
int getNativeTypeIndex ()
final Ruby getRuntime ()
RubyClass getSingletonClass ()
RubyClass getType ()
int getVariableCount ()
List< Variable< IRubyObject > > getVariableList ()
Map getVariableMap ()
List< String > getVariableNameList ()
RubyFixnum hash ()
RubyFixnum hash (ThreadContext context)
int hashCode ()
boolean hasInstanceVariable (String name)
boolean hasInternalVariable (String name)
boolean hasVariables ()
synchronized IRubyObject id ()
synchronized IRubyObject id_deprecated ()
RubyBoolean include_p (ThreadContext context, IRubyObject item)
boolean includes (ThreadContext context, IRubyObject item)
IRubyObject index (ThreadContext context, IRubyObject obj)
IRubyObject indexes (IRubyObject[] args)
int indexOf (Object element)
IRubyObject infectBy (IRubyObject obj)
IRubyObject initialize ()
IRubyObject initialize (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject initialize_copy (IRubyObject orig)
IRubyObject insert (IRubyObject[] args)
IRubyObject insert (IRubyObject arg1, IRubyObject arg2)
IRubyObject insert (IRubyObject arg)
IRubyObject insert ()
IRubyObject inspect ()
IRubyObject instance_eval (ThreadContext context, IRubyObject[] args, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
IRubyObject instance_eval (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject instance_eval (ThreadContext context, 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)
boolean isClass ()
boolean isEmpty ()
final boolean isFalse ()
boolean isFrozen ()
boolean isImmediate ()
boolean isModule ()
final boolean isNil ()
boolean isTaint ()
final boolean isTrue ()
Iterator iterator ()
RubyString join (ThreadContext context, IRubyObject sep)
RubyString join_m (ThreadContext context, IRubyObject[] args)
RubyBoolean kind_of_p (ThreadContext context, IRubyObject type)
IRubyObject last (IRubyObject arg0)
IRubyObject last ()
IRubyObject last (IRubyObject[] args)
int lastIndexOf (Object element)
RubyFixnum length ()
ListIterator listIterator (int index)
ListIterator listIterator ()
RubyClass makeMetaClass (RubyClass superClass)
IRubyObject method (IRubyObject symbol)
IRubyObject methods (ThreadContext context, IRubyObject[] args)
IRubyObject nil_p (ThreadContext context)
IRubyObject nitems ()
IRubyObject op_and (IRubyObject other)
IRubyObject op_cmp (ThreadContext context, IRubyObject obj)
IRubyObject op_diff (IRubyObject other)
IRubyObject op_eqq (ThreadContext context, IRubyObject other)
IRubyObject op_equal (ThreadContext context, IRubyObject obj)
IRubyObject op_match (ThreadContext context, IRubyObject arg)
IRubyObject op_or (IRubyObject other)
IRubyObject op_plus (IRubyObject obj)
IRubyObject op_times (ThreadContext context, IRubyObject times)
RubyString pack (ThreadContext context, IRubyObject obj)
IRubyObject pop ()
IRubyObject private_methods (ThreadContext context, IRubyObject[] args)
IRubyObject protected_methods (ThreadContext context, IRubyObject[] args)
IRubyObject public_methods (ThreadContext context, IRubyObject[] args)
RubyArray push_m (IRubyObject[] items)
IRubyObject rassoc (ThreadContext context, IRubyObject value)
IRubyObject rb_clear ()
IRubyObject rbClone ()
IRubyObject reject (ThreadContext context, Block block)
IRubyObject reject_bang (ThreadContext context, Block block)
Object remove (int index)
boolean remove (Object element)
IRubyObject remove_instance_variable (ThreadContext context, IRubyObject name, Block block)
boolean removeAll (Collection c)
void removeFinalizers ()
IRubyObject removeInstanceVariable (String name)
IRubyObject removeInternalVariable (String name)
IRubyObject replace (IRubyObject orig)
RubyBoolean respond_to_p (IRubyObject mname, IRubyObject includePrivate)
RubyBoolean respond_to_p (IRubyObject mname)
final boolean respondsTo (String name)
boolean retainAll (Collection c)
IRubyObject reverse ()
IRubyObject reverse_bang ()
IRubyObject reverse_each (ThreadContext context, Block block)
IRubyObject rindex (ThreadContext context, IRubyObject obj)
 RubyArray (Ruby runtime, RubyClass klass)
 RubyArray (Ruby runtime, long length, IRubyObject[] vals)
RubyArray select (ThreadContext context, Block block)
IRubyObject send (ThreadContext context, IRubyObject[] args, 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 send (ThreadContext context, IRubyObject arg0, Block block)
IRubyObject send (ThreadContext context, Block block)
Object set (int index, Object element)
final void setFlag (int flag, boolean set)
void setFrozen (boolean frozen)
IRubyObject setInstanceVariable (String name, IRubyObject value)
void setInternalVariable (String name, IRubyObject value)
void setMetaClass (RubyClass metaClass)
void setTaint (boolean taint)
IRubyObject shift ()
RubyArray singleton_methods (ThreadContext context, IRubyObject[] args)
int size ()
IRubyObject slice_bang (IRubyObject arg0, IRubyObject arg1)
IRubyObject slice_bang (IRubyObject arg0)
IRubyObject slice_bang (IRubyObject[] args)
RubyArray sort (Block block)
RubyArray sort_bang (Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block)
IRubyObject specificEval (ThreadContext context, RubyModule mod, IRubyObject arg0, IRubyObject arg1, 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)
final IRubyObject store (long index, IRubyObject value)
List subList (int fromIndex, int toIndex)
IRubyObject subseq (long beg, long len)
IRubyObject subseqLight (long beg, long len)
void syncVariables (List< Variable< IRubyObject >> variables)
IRubyObject taint (ThreadContext context)
RubyBoolean tainted_p (ThreadContext context)
RubyArray to_a ()
IRubyObject to_ary ()
IRubyObject to_java ()
IRubyObject to_s ()
Object[] toArray (final Object[] arg)
Object[] toArray ()
IRubyObject[] toJavaArray ()
IRubyObject[] toJavaArrayMaybeUnsafe ()
IRubyObject[] toJavaArrayUnsafe ()
String toString ()
RubyArray transpose ()
RubyClass type ()
RubyClass type_deprecated ()
IRubyObject uniq ()
IRubyObject uniq_bang ()
RubyArray unshift (IRubyObject item)
RubyArray unshift_m (IRubyObject[] items)
IRubyObject untaint (ThreadContext context)
IRubyObject values_at (IRubyObject[] args)
IRubyObject zip (ThreadContext context, IRubyObject[] args, Block block)

Static Public Member Functions

static IRubyObject create (IRubyObject klass, IRubyObject[] args, Block block)
static RubyClass createArrayClass (Ruby runtime)
static RubyClass createObjectClass (Ruby runtime, RubyClass objectClass)
static void marshalTo (RubyArray array, MarshalStream output) throws IOException
static RubyArray newArray (Ruby runtime, Collection collection)
static RubyArray newArray (Ruby runtime, IRubyObject[] args)
static RubyArray newArray (Ruby runtime, IRubyObject car, IRubyObject cdr)
static RubyArray newArray (Ruby runtime, IRubyObject obj)
static final RubyArray newArray (final Ruby runtime)
static final RubyArray newArray (final Ruby runtime, final long len)
static RubyArray newArrayLight (Ruby runtime, IRubyObject obj)
static final RubyArray newArrayLight (final Ruby runtime)
static final RubyArray newArrayLight (final Ruby runtime, final long len)
static RubyArray newArrayNoCopy (Ruby runtime, IRubyObject[] args, int begin)
static RubyArray newArrayNoCopy (Ruby runtime, IRubyObject[] args)
static RubyArray newArrayNoCopyLight (Ruby runtime, IRubyObject[] args)
static RubyArray newEmptyArray (Ruby runtime)
static void puts (Object obj)
static RubyArray unmarshalFrom (UnmarshalStream input) throws IOException

Static Public Attributes

static final int ALL_F = -1
static final int ARRAY_DEFAULT_SIZE = 16
static final int FALSE_F = 1 << 0
static final int FL_USHIFT = 4
static final int FROZEN_F = 1 << 2
static final IRubyObject NEVER = new RubyObject()
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 RubyObject()
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 ()
void copySpecialInstanceVariables (IRubyObject clone)
void ensureInstanceVariablesSettable ()
RubyClass getSingletonClassClone ()
final void testFrozen (String message)
String validateInstanceVariable (String name)
boolean variableTableContains (String name)
boolean variableTableFastContains (String internedName)
IRubyObject variableTableFastFetch (String internedName)
IRubyObject variableTableFastStore (String internedName, IRubyObject value)
IRubyObject variableTableFetch (String name)
Map variableTableGetMap (Map map)
Map variableTableGetMap ()
int variableTableGetSize ()
VariableTableEntry[] variableTableGetTable ()
synchronized IRubyObject variableTableReadLocked (VariableTableEntry entry)
final VariableTableEntry[] variableTableRehash ()
IRubyObject variableTableRemove (String name)
IRubyObject variableTableStore (String name, IRubyObject value)
void variableTableSync (List< Variable< IRubyObject >> 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)
static final boolean isRubyVariable (String name)

Protected Attributes

transient Object dataStruct
int flags
transient RubyClass metaClass
transient volatile
VariableTableEntry[] 
variableTable
transient int variableTableSize
transient int variableTableThreshold

Static Protected Attributes

static final String ERR_INSECURE_SET_INST_VAR = "Insecure: can't modify instance variable"
static final int VARIABLE_TABLE_DEFAULT_CAPACITY = 8
static final VariableTableEntry[] VARIABLE_TABLE_EMPTY_TABLE = new VariableTableEntry[0]
static final float VARIABLE_TABLE_LOAD_FACTOR = 0.75f
static final int VARIABLE_TABLE_MAXIMUM_CAPACITY = 1 << 30

Static Package Functions

static RubyString inspect (ThreadContext context, IRubyObject object)

Private Member Functions

final void alloc (int length)
final void checkLength (long length)
final void concurrentModification ()
final IRubyObject delete_at (int pos)
final IRubyObject elt (long offset)
final int flatten (ThreadContext context, int index, RubyArray ary2, RubyArray memo)
IRubyObject inspectAry (ThreadContext context)
IRubyObject inspectJoin (ThreadContext context, RubyArray tmp, IRubyObject sep)
final RubyHash makeHash (RubyArray ary2)
final RubyArray makeShared (int beg, int len, RubyClass klass, boolean objectSpace)
final RubyArray makeShared (int beg, int len, RubyClass klass)
final void modify ()
final void modifyCheck ()
final void realloc (int newLength)
final IRubyObject[] reserve (int length)
 RubyArray (Ruby runtime, RubyClass klass, RubyArray original)
 RubyArray (Ruby runtime, RubyClass klass, boolean objectSpace)
 RubyArray (Ruby runtime, RubyClass klass, long length, boolean objectspace)
 RubyArray (Ruby runtime, RubyClass klass, long length)
 RubyArray (Ruby runtime, RubyClass klass, int length)
 RubyArray (Ruby runtime)
 RubyArray (Ruby runtime, boolean objectSpace)
 RubyArray (Ruby runtime, long length, boolean objectspace)
 RubyArray (Ruby runtime, long length)
 RubyArray (Ruby runtime, IRubyObject[] vals, int begin)
 RubyArray (Ruby runtime, IRubyObject[] vals, boolean objectSpace)
 RubyArray (Ruby runtime, IRubyObject[] vals)
final void splice (long beg, long len, IRubyObject rpl)
final void spliceOne (long beg, long len, IRubyObject rpl)
final IRubyObject values_at (long olen, IRubyObject[] args)

Static Private Member Functions

static RubyArray aryToAry (IRubyObject obj)

Private Attributes

int begin = 0
volatile boolean isShared = false
int realLength = 0
volatile IRubyObject[] values

Static Private Attributes

static ObjectAllocator ARRAY_ALLOCATOR
static final int TMPLOCK_ARR_F = 1 << 9
static final int TMPLOCK_OR_FROZEN_ARR_F = TMPLOCK_ARR_F | FROZEN_F

Classes

class  BlockComparator
class  DefaultComparator
class  RubyArrayConversionIterator
class  RubyArrayConversionListIterator

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

Generated by  Doxygen 1.6.0   Back to index