org.jruby
Class RubyArray

java.lang.Object
  extended by org.jruby.RubyBasicObject
      extended by org.jruby.RubyObject
          extended by org.jruby.RubyArray
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType

public class RubyArray
extends RubyObject
implements java.util.List

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.

See Also:
Serialized Form

Nested Class Summary
 class RubyArray.RubyArrayConversionIterator
           
 
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.ObjectMethods
 
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.BasicObjectMethods, RubyBasicObject.Finalizer, RubyBasicObject.VariableTableEntry
 
Field Summary
static int ARRAY_DEFAULT_SIZE
           
 
Fields inherited from class org.jruby.RubyObject
OBJECT_ALLOCATOR
 
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, dataStruct, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold
 
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
 
Constructor Summary
RubyArray(Ruby runtime, RubyClass klass)
           
 
Method Summary
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object element)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 RubyArray append(IRubyObject item)
          rb_ary_push - specialized rb_ary_store
 IRubyObject aref(IRubyObject arg0)
          rb_ary_aref
 IRubyObject aref(IRubyObject[] args)
          Deprecated. Use the versions with zero, one, or two args.
 IRubyObject aref(IRubyObject arg0, IRubyObject arg1)
          rb_ary_aref
 RubyArray aryDup()
          rb_ary_dup
 IRubyObject aset(IRubyObject[] args)
          Deprecated. Use the versions with zero, one, or two args.
 IRubyObject aset(IRubyObject arg0, IRubyObject arg1)
          rb_ary_aset
 IRubyObject aset(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
          rb_ary_aset
 IRubyObject assoc(ThreadContext context, IRubyObject key)
          rb_ary_assoc
 IRubyObject at(IRubyObject pos)
          rb_ary_at
 IRubyObject checkArrayType()
          rb_check_array_type Returns the result of trying to convert this object to an Array with "to_ary".
 void clear()
           
 RubyArray collect_bang(ThreadContext context, Block block)
          rb_ary_collect_bang
 IRubyObject collect_bang19(ThreadContext context, Block block)
          rb_ary_collect_bang
 RubyArray collect(ThreadContext context, Block block)
          rb_ary_collect
 IRubyObject combination(ThreadContext context, IRubyObject num, Block block)
          rb_ary_combination
 IRubyObject compact_bang()
          rb_ary_compact_bang
 IRubyObject compact()
          rb_ary_compact
 RubyArray concat(IRubyObject obj)
          rb_ary_concat
 boolean contains(java.lang.Object element)
           
 boolean containsAll(java.util.Collection c)
           
 RubyArray convertToArray()
          Tries to convert this object to a Ruby Array using the "to_ary" method.
 IRubyObject count(ThreadContext context, Block block)
           
 IRubyObject count(ThreadContext context, IRubyObject obj, Block block)
           
static IRubyObject create(IRubyObject klass, IRubyObject[] args, Block block)
          rb_ary_s_create
static RubyClass createArrayClass(Ruby runtime)
           
 IRubyObject cycle(ThreadContext context, Block block)
          rb_ary_cycle
 IRubyObject cycle(ThreadContext context, IRubyObject arg, Block block)
          rb_ary_cycle
 IRubyObject delete_at(IRubyObject obj)
          rb_ary_delete_at_m
 IRubyObject delete_if(ThreadContext context, Block block)
          rb_ary_delete_if
 IRubyObject delete_if19(ThreadContext context, Block block)
           
 IRubyObject delete(ThreadContext context, IRubyObject item, Block block)
          rb_ary_delete
 IRubyObject drop_while(ThreadContext context, Block block)
          rb_ary_take_while
 IRubyObject drop(ThreadContext context, IRubyObject n)
          rb_ary_take
 IRubyObject each_index(ThreadContext context, Block block)
          rb_ary_each_index
 IRubyObject each_index19(ThreadContext context, Block block)
           
 IRubyObject each(ThreadContext context, Block block)
          rb_ary_each
 IRubyObject each19(ThreadContext context, Block block)
           
 IRubyObject eltInternal(int offset)
           
 IRubyObject eltInternalSet(int offset, IRubyObject item)
           
 IRubyObject empty_p()
          rb_ary_empty_p
 IRubyObject entry(int offset)
          rb_ary_entry
 IRubyObject entry(long offset)
          rb_ary_entry
 RubyBoolean eql_p(ThreadContext context, IRubyObject obj)
          rb_ary_eql
 IRubyObject fetch(ThreadContext context, IRubyObject[] args, Block block)
          Deprecated. Use the versions with zero, one, or two args.
 IRubyObject fetch(ThreadContext context, IRubyObject arg0, Block block)
          rb_ary_fetch
 IRubyObject fetch(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
          rb_ary_fetch
 IRubyObject fill(ThreadContext context, Block block)
           
 IRubyObject fill(ThreadContext context, IRubyObject arg, Block block)
           
 IRubyObject fill(ThreadContext context, IRubyObject arg1, IRubyObject arg2, Block block)
           
 IRubyObject fill(ThreadContext context, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block)
           
 IRubyObject first()
          rb_ary_first
 IRubyObject first(IRubyObject arg0)
          rb_ary_first
 IRubyObject first(IRubyObject[] args)
          Deprecated. Use the versions with zero, one, or two args.
 IRubyObject flatten_bang(ThreadContext context)
          rb_ary_flatten_bang
 IRubyObject flatten_bang19(ThreadContext context)
           
 IRubyObject flatten_bang19(ThreadContext context, IRubyObject arg)
           
 IRubyObject flatten(ThreadContext context)
          rb_ary_flatten
 IRubyObject flatten19(ThreadContext context)
           
 IRubyObject flatten19(ThreadContext context, IRubyObject arg)
           
 RubyBoolean frozen_p(ThreadContext context)
          rb_ary_frozen_p
 java.lang.Object get(int index)
           
 java.lang.Class getJavaClass()
          Will return the Java interface that most closely can represent this object, when working through JAva integration translations.
 int getLength()
           
 java.util.List getList()
          Getter for property list.
 int getNativeTypeIndex()
          This is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.
 RubyFixnum hash(ThreadContext context)
          rb_ary_hash
 RubyBoolean include_p(ThreadContext context, IRubyObject item)
          rb_ary_includes
 boolean includes(ThreadContext context, IRubyObject item)
           
 IRubyObject index(ThreadContext context, IRubyObject obj)
          rb_ary_index
 IRubyObject index19(ThreadContext context, Block block)
           
 IRubyObject index19(ThreadContext context, IRubyObject obj, Block unused)
           
 IRubyObject indexes(IRubyObject[] args)
          rb_ary_indexes
 int indexOf(java.lang.Object element)
           
 IRubyObject initialize_copy(IRubyObject orig)
          rb_ary_initialize_copy
 IRubyObject initialize(ThreadContext context, Block block)
          rb_ary_initialize
 IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block block)
          Deprecated. Use the versions with zero, one, or two args.
 IRubyObject initialize(ThreadContext context, IRubyObject arg0, Block block)
          rb_ary_initialize
 IRubyObject initialize(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
          rb_ary_initialize
 IRubyObject insert()
           
 IRubyObject insert(IRubyObject arg)
          rb_ary_insert
 IRubyObject insert(IRubyObject[] args)
          rb_ary_insert
 IRubyObject insert(IRubyObject arg1, IRubyObject arg2)
          rb_ary_insert
 IRubyObject inspect()
          rb_ary_inspect
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 RubyString join_m(ThreadContext context, IRubyObject[] args)
          rb_ary_join_m
 RubyString join(ThreadContext context, IRubyObject sep)
          rb_ary_join
 IRubyObject last()
          rb_ary_last
 IRubyObject last(IRubyObject arg0)
          rb_ary_last
 IRubyObject last(IRubyObject[] args)
          Deprecated. Use the versions with zero, one, or two args.
 int lastIndexOf(java.lang.Object element)
           
 RubyFixnum length()
          rb_ary_length
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 IRubyObject map_bang19(ThreadContext context, Block block)
          rb_ary_collect_bang
static void marshalTo(RubyArray array, MarshalStream output)
           
static RubyArray newArray(Ruby runtime)
          rb_ary_new
static RubyArray newArray(Ruby runtime, java.util.Collection<IRubyObject> collection)
           
static RubyArray newArray(Ruby runtime, IRubyObject obj)
           
static RubyArray newArray(Ruby runtime, IRubyObject[] args)
          rb_ary_new4, rb_ary_new3
static RubyArray newArray(Ruby runtime, IRubyObject car, IRubyObject cdr)
          rb_assoc_new
static RubyArray newArray(Ruby runtime, long len)
          rb_ary_new2
static RubyArray newArrayLight(Ruby runtime)
          rb_ary_new
static RubyArray newArrayLight(Ruby runtime, IRubyObject... objs)
           
static RubyArray newArrayLight(Ruby runtime, IRubyObject obj)
           
static RubyArray newArrayLight(Ruby runtime, long len)
           
static RubyArray newArrayNoCopy(Ruby runtime, IRubyObject[] args)
           
static RubyArray newArrayNoCopy(Ruby runtime, IRubyObject[] args, int begin)
           
static RubyArray newArrayNoCopy(Ruby runtime, IRubyObject[] args, int begin, int length)
           
static RubyArray newArrayNoCopyLight(Ruby runtime, IRubyObject[] args)
           
static RubyArray newEmptyArray(Ruby runtime)
           
 IRubyObject nitems()
          rb_ary_nitems
 IRubyObject op_and(IRubyObject other)
          rb_ary_and
 IRubyObject op_cmp(ThreadContext context, IRubyObject obj)
          rb_ary_cmp
 IRubyObject op_diff(IRubyObject other)
          rb_ary_diff
 IRubyObject op_equal(ThreadContext context, IRubyObject obj)
          rb_ary_equal
 IRubyObject op_or(IRubyObject other)
          rb_ary_or
 IRubyObject op_plus(IRubyObject obj)
          rb_ary_plus
 IRubyObject op_times(ThreadContext context, IRubyObject times)
          rb_ary_times
 RubyString pack(ThreadContext context, IRubyObject obj)
           
 IRubyObject permutation(ThreadContext context, Block block)
           
 IRubyObject permutation(ThreadContext context, IRubyObject num, Block block)
          rb_ary_permutation
 IRubyObject pop(ThreadContext context)
          rb_ary_pop
 IRubyObject pop19(ThreadContext context)
           
 IRubyObject pop19(ThreadContext context, IRubyObject num)
           
 IRubyObject product(ThreadContext context, IRubyObject[] args)
          rb_ary_product
 RubyArray push_m(IRubyObject[] items)
          rb_ary_push_m FIXME: Whis is this named "push_m"?
 IRubyObject rassoc(ThreadContext context, IRubyObject value)
          rb_ary_rassoc
 IRubyObject rb_clear()
          rb_ary_clear
 IRubyObject reject_bang(ThreadContext context, Block block)
          rb_ary_reject_bang
 IRubyObject reject_bang19(ThreadContext context, Block block)
           
 IRubyObject reject(ThreadContext context, Block block)
          rb_ary_reject_bang
 IRubyObject reject19(ThreadContext context, Block block)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object element)
           
 boolean removeAll(java.util.Collection c)
           
 IRubyObject replace(IRubyObject orig)
          rb_ary_replace
 boolean retainAll(java.util.Collection c)
           
 IRubyObject reverse_bang()
          rb_ary_reverse_bang
 IRubyObject reverse_each(ThreadContext context, Block block)
          rb_ary_reverse_each
 IRubyObject reverse()
          rb_ary_reverse_m
 IRubyObject rindex(ThreadContext context, IRubyObject obj)
          rb_ary_rindex
 IRubyObject rindex19(ThreadContext context, Block block)
           
 IRubyObject rindex19(ThreadContext context, IRubyObject obj, Block unused)
           
 IRubyObject sample(ThreadContext context)
           
 IRubyObject sample(ThreadContext context, IRubyObject nv)
           
 RubyArray select(ThreadContext context, Block block)
          rb_ary_select
 IRubyObject select19(ThreadContext context, Block block)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 IRubyObject shift(ThreadContext context)
          rb_ary_shift
 IRubyObject shift19(ThreadContext context)
           
 IRubyObject shift19(ThreadContext context, IRubyObject num)
           
 IRubyObject shuffle_bang(ThreadContext context)
           
 IRubyObject shuffle(ThreadContext context)
           
 int size()
           
 IRubyObject slice_bang(IRubyObject arg0)
          rb_ary_slice_bang
 IRubyObject slice_bang(IRubyObject[] args)
          Deprecated. Use the versions with zero, one, or two args.
 IRubyObject slice_bang(IRubyObject arg0, IRubyObject arg1)
          rb_ary_slice_bang
 RubyArray sort_bang(Block block)
          rb_ary_sort_bang
 RubyArray sort(Block block)
          rb_ary_sort
 IRubyObject store(long index, IRubyObject value)
          rb_ary_store
 java.util.List subList(int fromIndex, int toIndex)
           
 IRubyObject subseq(long beg, long len)
          rb_ary_subseq
 IRubyObject subseqLight(long beg, long len)
          rb_ary_subseq
 IRubyObject take_while(ThreadContext context, Block block)
          rb_ary_take_while
 IRubyObject take(ThreadContext context, IRubyObject n)
          rb_ary_take
 RubyArray to_a()
          rb_ary_to_a
 IRubyObject to_ary()
           
 IRubyObject to_s()
          rb_ary_to_s
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] arg)
           
 IRubyObject[] toJavaArray()
           
 IRubyObject[] toJavaArrayMaybeUnsafe()
           
 IRubyObject[] toJavaArrayUnsafe()
           
 RubyArray transpose()
          rb_ary_transpose
 IRubyObject uniq_bang()
          rb_ary_uniq_bang
 IRubyObject uniq()
          rb_ary_uniq
static RubyArray unmarshalFrom(UnmarshalStream input)
           
 RubyArray unshift_m(IRubyObject[] items)
          rb_ary_unshift_m
 RubyArray unshift(IRubyObject item)
          rb_ary_unshift
 IRubyObject values_at(IRubyObject[] args)
          rb_values_at
 IRubyObject zip(ThreadContext context, IRubyObject[] args, Block block)
          rb_ary_zip
 
Methods inherited from class org.jruby.RubyObject
as, attachToObjectSpace, callInit, checkFrozen, convertToType, createObjectClass, display, dup, eql_p, eqlInternal, equal_p, equalInternal, equals, evalUnder, evalUnder, extend, freeze, hash, hashCode, id_deprecated, id, initialize, 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, kind_of_p, method, methods, nil_p, op_eqq, op_match, private_methods, protected_methods, public_methods, puts, rbClone, remove_instance_variable, respond_to_p, respond_to_p, send, send, send, send, send, singleton_methods, singleton_methods19, singletonMethods, specificEval, specificEval, specificEval, specificEval, specificEval, taint, tainted_p, to_java, toString, type_deprecated, type, untaint, validateInstanceVariable
 
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkStringType, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataWrapStruct, ensureInstanceVariablesSettable, eql, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, getFlag, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariableList, getInternalVariables, getMetaClass, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariableCount, getVariableList, getVariableMap, getVariableNameList, hasInstanceVariable, hasInternalVariable, hasVariables, infectBy, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isRubyVariable, isTaint, isTrue, makeMetaClass, op_not_equal, op_not, removeFinalizers, removeInstanceVariable, removeInternalVariable, respondsTo, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, syncVariables, taint, testFrozen, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableGetMap, variableTableGetMap, variableTableGetSize, variableTableGetTable, variableTableReadLocked, variableTableRehash, variableTableRemove, variableTableStore, variableTableSync
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
equals, hashCode
 

Field Detail

ARRAY_DEFAULT_SIZE

public static final int ARRAY_DEFAULT_SIZE
See Also:
Constant Field Values
Constructor Detail

RubyArray

public RubyArray(Ruby runtime,
                 RubyClass klass)
Method Detail

createArrayClass

public static RubyClass createArrayClass(Ruby runtime)

getNativeTypeIndex

public int getNativeTypeIndex()
Description copied from class: RubyObject
This 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:
getNativeTypeIndex in interface CoreObjectType
Overrides:
getNativeTypeIndex in class RubyObject
Returns:
the ClassIndex of the native type this object was constructed from
See Also:
org.jruby.runtime.ClassInde

create

public static IRubyObject create(IRubyObject klass,
                                 IRubyObject[] args,
                                 Block block)
rb_ary_s_create


newArray

public static final RubyArray newArray(Ruby runtime,
                                       long len)
rb_ary_new2


newArrayLight

public static final RubyArray newArrayLight(Ruby runtime,
                                            long len)

newArray

public static final RubyArray newArray(Ruby runtime)
rb_ary_new


newArrayLight

public static final RubyArray newArrayLight(Ruby runtime)
rb_ary_new


newArray

public static RubyArray newArray(Ruby runtime,
                                 IRubyObject obj)

newArrayLight

public static RubyArray newArrayLight(Ruby runtime,
                                      IRubyObject obj)

newArrayLight

public static RubyArray newArrayLight(Ruby runtime,
                                      IRubyObject... objs)

newArray

public static RubyArray newArray(Ruby runtime,
                                 IRubyObject car,
                                 IRubyObject cdr)
rb_assoc_new


newEmptyArray

public static RubyArray newEmptyArray(Ruby runtime)

newArray

public static RubyArray newArray(Ruby runtime,
                                 IRubyObject[] args)
rb_ary_new4, rb_ary_new3


newArrayNoCopy

public static RubyArray newArrayNoCopy(Ruby runtime,
                                       IRubyObject[] args)

newArrayNoCopy

public static RubyArray newArrayNoCopy(Ruby runtime,
                                       IRubyObject[] args,
                                       int begin)

newArrayNoCopy

public static RubyArray newArrayNoCopy(Ruby runtime,
                                       IRubyObject[] args,
                                       int begin,
                                       int length)

newArrayNoCopyLight

public static RubyArray newArrayNoCopyLight(Ruby runtime,
                                            IRubyObject[] args)

newArray

public static RubyArray newArray(Ruby runtime,
                                 java.util.Collection<IRubyObject> collection)

getList

public java.util.List getList()
Getter for property list.

Returns:
Value of property list.

getLength

public int getLength()

toJavaArray

public IRubyObject[] toJavaArray()

toJavaArrayUnsafe

public IRubyObject[] toJavaArrayUnsafe()

toJavaArrayMaybeUnsafe

public IRubyObject[] toJavaArrayMaybeUnsafe()

initialize

public IRubyObject initialize(ThreadContext context,
                              IRubyObject[] args,
                              Block block)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


initialize

public IRubyObject initialize(ThreadContext context,
                              Block block)
rb_ary_initialize


initialize

public IRubyObject initialize(ThreadContext context,
                              IRubyObject arg0,
                              Block block)
rb_ary_initialize


initialize

public IRubyObject initialize(ThreadContext context,
                              IRubyObject arg0,
                              IRubyObject arg1,
                              Block block)
rb_ary_initialize


initialize_copy

public IRubyObject initialize_copy(IRubyObject orig)
rb_ary_initialize_copy

Overrides:
initialize_copy in class RubyObject

replace

public IRubyObject replace(IRubyObject orig)
rb_ary_replace


to_s

public IRubyObject to_s()
rb_ary_to_s

Overrides:
to_s in class RubyObject

includes

public boolean includes(ThreadContext context,
                        IRubyObject item)

hash

public RubyFixnum hash(ThreadContext context)
rb_ary_hash


store

public final IRubyObject store(long index,
                               IRubyObject value)
rb_ary_store


entry

public final IRubyObject entry(long offset)
rb_ary_entry


entry

public final IRubyObject entry(int offset)
rb_ary_entry


eltInternal

public final IRubyObject eltInternal(int offset)

eltInternalSet

public final IRubyObject eltInternalSet(int offset,
                                        IRubyObject item)

fetch

public IRubyObject fetch(ThreadContext context,
                         IRubyObject[] args,
                         Block block)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


fetch

public IRubyObject fetch(ThreadContext context,
                         IRubyObject arg0,
                         Block block)
rb_ary_fetch


fetch

public IRubyObject fetch(ThreadContext context,
                         IRubyObject arg0,
                         IRubyObject arg1,
                         Block block)
rb_ary_fetch


insert

public IRubyObject insert()

insert

public IRubyObject insert(IRubyObject arg)
rb_ary_insert


insert

public IRubyObject insert(IRubyObject arg1,
                          IRubyObject arg2)
rb_ary_insert


insert

public IRubyObject insert(IRubyObject[] args)
rb_ary_insert


aryDup

public final RubyArray aryDup()
rb_ary_dup


transpose

public RubyArray transpose()
rb_ary_transpose


values_at

public IRubyObject values_at(IRubyObject[] args)
rb_values_at


subseq

public IRubyObject subseq(long beg,
                          long len)
rb_ary_subseq


subseqLight

public IRubyObject subseqLight(long beg,
                               long len)
rb_ary_subseq


length

public RubyFixnum length()
rb_ary_length


append

public RubyArray append(IRubyObject item)
rb_ary_push - specialized rb_ary_store


push_m

public RubyArray push_m(IRubyObject[] items)
rb_ary_push_m FIXME: Whis is this named "push_m"?


pop

public IRubyObject pop(ThreadContext context)
rb_ary_pop


pop19

public IRubyObject pop19(ThreadContext context)

pop19

public IRubyObject pop19(ThreadContext context,
                         IRubyObject num)

shift

public IRubyObject shift(ThreadContext context)
rb_ary_shift


shift19

public IRubyObject shift19(ThreadContext context)

shift19

public IRubyObject shift19(ThreadContext context,
                           IRubyObject num)

unshift

public RubyArray unshift(IRubyObject item)
rb_ary_unshift


unshift_m

public RubyArray unshift_m(IRubyObject[] items)
rb_ary_unshift_m


include_p

public RubyBoolean include_p(ThreadContext context,
                             IRubyObject item)
rb_ary_includes


frozen_p

public RubyBoolean frozen_p(ThreadContext context)
rb_ary_frozen_p

Overrides:
frozen_p in class RubyObject

aref

public IRubyObject aref(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


aref

public IRubyObject aref(IRubyObject arg0)
rb_ary_aref


aref

public IRubyObject aref(IRubyObject arg0,
                        IRubyObject arg1)
rb_ary_aref


aset

public IRubyObject aset(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


aset

public IRubyObject aset(IRubyObject arg0,
                        IRubyObject arg1)
rb_ary_aset


aset

public IRubyObject aset(IRubyObject arg0,
                        IRubyObject arg1,
                        IRubyObject arg2)
rb_ary_aset


at

public IRubyObject at(IRubyObject pos)
rb_ary_at


concat

public RubyArray concat(IRubyObject obj)
rb_ary_concat


inspect

public IRubyObject inspect()
rb_ary_inspect

Specified by:
inspect in interface IRubyObject
Overrides:
inspect in class RubyObject
Returns:
String

first

public IRubyObject first(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


first

public IRubyObject first()
rb_ary_first


first

public IRubyObject first(IRubyObject arg0)
rb_ary_first


last

public IRubyObject last(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


last

public IRubyObject last()
rb_ary_last


last

public IRubyObject last(IRubyObject arg0)
rb_ary_last


each

public IRubyObject each(ThreadContext context,
                        Block block)
rb_ary_each


each19

public IRubyObject each19(ThreadContext context,
                          Block block)

each_index

public IRubyObject each_index(ThreadContext context,
                              Block block)
rb_ary_each_index


each_index19

public IRubyObject each_index19(ThreadContext context,
                                Block block)

reverse_each

public IRubyObject reverse_each(ThreadContext context,
                                Block block)
rb_ary_reverse_each


join

public RubyString join(ThreadContext context,
                       IRubyObject sep)
rb_ary_join


join_m

public RubyString join_m(ThreadContext context,
                         IRubyObject[] args)
rb_ary_join_m


to_a

public RubyArray to_a()
rb_ary_to_a

Overrides:
to_a in class RubyObject

to_ary

public IRubyObject to_ary()

convertToArray

public RubyArray convertToArray()
Description copied from class: RubyBasicObject
Tries to convert this object to a Ruby Array using the "to_ary" method.

Specified by:
convertToArray in interface IRubyObject
Overrides:
convertToArray in class RubyBasicObject
Returns:

checkArrayType

public IRubyObject checkArrayType()
Description copied from class: RubyBasicObject
rb_check_array_type Returns the result of trying to convert this object to an Array with "to_ary".

Specified by:
checkArrayType in interface IRubyObject
Overrides:
checkArrayType in class RubyBasicObject
Returns:

op_equal

public IRubyObject op_equal(ThreadContext context,
                            IRubyObject obj)
rb_ary_equal

Specified by:
op_equal in interface IRubyObject
Overrides:
op_equal in class RubyObject

eql_p

public RubyBoolean eql_p(ThreadContext context,
                         IRubyObject obj)
rb_ary_eql


compact_bang

public IRubyObject compact_bang()
rb_ary_compact_bang


compact

public IRubyObject compact()
rb_ary_compact


empty_p

public IRubyObject empty_p()
rb_ary_empty_p


rb_clear

public IRubyObject rb_clear()
rb_ary_clear


fill

public IRubyObject fill(ThreadContext context,
                        Block block)

fill

public IRubyObject fill(ThreadContext context,
                        IRubyObject arg,
                        Block block)

fill

public IRubyObject fill(ThreadContext context,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        Block block)

fill

public IRubyObject fill(ThreadContext context,
                        IRubyObject arg1,
                        IRubyObject arg2,
                        IRubyObject arg3,
                        Block block)

index

public IRubyObject index(ThreadContext context,
                         IRubyObject obj)
rb_ary_index


index19

public IRubyObject index19(ThreadContext context,
                           IRubyObject obj,
                           Block unused)

index19

public IRubyObject index19(ThreadContext context,
                           Block block)

rindex

public IRubyObject rindex(ThreadContext context,
                          IRubyObject obj)
rb_ary_rindex


rindex19

public IRubyObject rindex19(ThreadContext context,
                            IRubyObject obj,
                            Block unused)

rindex19

public IRubyObject rindex19(ThreadContext context,
                            Block block)

indexes

public IRubyObject indexes(IRubyObject[] args)
rb_ary_indexes


reverse_bang

public IRubyObject reverse_bang()
rb_ary_reverse_bang


reverse

public IRubyObject reverse()
rb_ary_reverse_m


collect

public RubyArray collect(ThreadContext context,
                         Block block)
rb_ary_collect


collect_bang

public RubyArray collect_bang(ThreadContext context,
                              Block block)
rb_ary_collect_bang


collect_bang19

public IRubyObject collect_bang19(ThreadContext context,
                                  Block block)
rb_ary_collect_bang


map_bang19

public IRubyObject map_bang19(ThreadContext context,
                              Block block)
rb_ary_collect_bang


select

public RubyArray select(ThreadContext context,
                        Block block)
rb_ary_select


select19

public IRubyObject select19(ThreadContext context,
                            Block block)

delete

public IRubyObject delete(ThreadContext context,
                          IRubyObject item,
                          Block block)
rb_ary_delete


delete_at

public IRubyObject delete_at(IRubyObject obj)
rb_ary_delete_at_m


reject

public IRubyObject reject(ThreadContext context,
                          Block block)
rb_ary_reject_bang


reject19

public IRubyObject reject19(ThreadContext context,
                            Block block)

reject_bang

public IRubyObject reject_bang(ThreadContext context,
                               Block block)
rb_ary_reject_bang


reject_bang19

public IRubyObject reject_bang19(ThreadContext context,
                                 Block block)

delete_if

public IRubyObject delete_if(ThreadContext context,
                             Block block)
rb_ary_delete_if


delete_if19

public IRubyObject delete_if19(ThreadContext context,
                               Block block)

zip

public IRubyObject zip(ThreadContext context,
                       IRubyObject[] args,
                       Block block)
rb_ary_zip


op_cmp

public IRubyObject op_cmp(ThreadContext context,
                          IRubyObject obj)
rb_ary_cmp


slice_bang

public IRubyObject slice_bang(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args.

Variable arity version for compatibility. Not bound to a Ruby method.


slice_bang

public IRubyObject slice_bang(IRubyObject arg0)
rb_ary_slice_bang


slice_bang

public IRubyObject slice_bang(IRubyObject arg0,
                              IRubyObject arg1)
rb_ary_slice_bang


assoc

public IRubyObject assoc(ThreadContext context,
                         IRubyObject key)
rb_ary_assoc


rassoc

public IRubyObject rassoc(ThreadContext context,
                          IRubyObject value)
rb_ary_rassoc


flatten_bang

public IRubyObject flatten_bang(ThreadContext context)
rb_ary_flatten_bang


flatten

public IRubyObject flatten(ThreadContext context)
rb_ary_flatten


flatten_bang19

public IRubyObject flatten_bang19(ThreadContext context)

flatten_bang19

public IRubyObject flatten_bang19(ThreadContext context,
                                  IRubyObject arg)

flatten19

public IRubyObject flatten19(ThreadContext context)

flatten19

public IRubyObject flatten19(ThreadContext context,
                             IRubyObject arg)

count

public IRubyObject count(ThreadContext context,
                         Block block)

count

public IRubyObject count(ThreadContext context,
                         IRubyObject obj,
                         Block block)

nitems

public IRubyObject nitems()
rb_ary_nitems


op_plus

public IRubyObject op_plus(IRubyObject obj)
rb_ary_plus


op_times

public IRubyObject op_times(ThreadContext context,
                            IRubyObject times)
rb_ary_times


uniq_bang

public IRubyObject uniq_bang()
rb_ary_uniq_bang


uniq

public IRubyObject uniq()
rb_ary_uniq


op_diff

public IRubyObject op_diff(IRubyObject other)
rb_ary_diff


op_and

public IRubyObject op_and(IRubyObject other)
rb_ary_and


op_or

public IRubyObject op_or(IRubyObject other)
rb_ary_or


sort

public RubyArray sort(Block block)
rb_ary_sort


sort_bang

public RubyArray sort_bang(Block block)
rb_ary_sort_bang


take

public IRubyObject take(ThreadContext context,
                        IRubyObject n)
rb_ary_take


take_while

public IRubyObject take_while(ThreadContext context,
                              Block block)
rb_ary_take_while


drop

public IRubyObject drop(ThreadContext context,
                        IRubyObject n)
rb_ary_take


drop_while

public IRubyObject drop_while(ThreadContext context,
                              Block block)
rb_ary_take_while


cycle

public IRubyObject cycle(ThreadContext context,
                         Block block)
rb_ary_cycle


cycle

public IRubyObject cycle(ThreadContext context,
                         IRubyObject arg,
                         Block block)
rb_ary_cycle


product

public IRubyObject product(ThreadContext context,
                           IRubyObject[] args)
rb_ary_product


combination

public IRubyObject combination(ThreadContext context,
                               IRubyObject num,
                               Block block)
rb_ary_combination


permutation

public IRubyObject permutation(ThreadContext context,
                               IRubyObject num,
                               Block block)
rb_ary_permutation


permutation

public IRubyObject permutation(ThreadContext context,
                               Block block)

shuffle_bang

public IRubyObject shuffle_bang(ThreadContext context)

shuffle

public IRubyObject shuffle(ThreadContext context)

sample

public IRubyObject sample(ThreadContext context)

sample

public IRubyObject sample(ThreadContext context,
                          IRubyObject nv)

marshalTo

public static void marshalTo(RubyArray array,
                             MarshalStream output)
                      throws java.io.IOException
Throws:
java.io.IOException

unmarshalFrom

public static RubyArray unmarshalFrom(UnmarshalStream input)
                               throws java.io.IOException
Throws:
java.io.IOException

pack

public RubyString pack(ThreadContext context,
                       IRubyObject obj)
See Also:
Pack.pack(org.jruby.Ruby, org.jruby.RubyArray, ByteList)

getJavaClass

public java.lang.Class getJavaClass()
Description copied from class: RubyBasicObject
Will return the Java interface that most closely can represent this object, when working through JAva integration translations.

Specified by:
getJavaClass in interface IRubyObject
Overrides:
getJavaClass in class RubyBasicObject
Returns:
Class

size

public int size()
Specified by:
size in interface java.util.Collection
Specified by:
size in interface java.util.List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection
Specified by:
isEmpty in interface java.util.List

contains

public boolean contains(java.lang.Object element)
Specified by:
contains in interface java.util.Collection
Specified by:
contains in interface java.util.List

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] arg)
Specified by:
toArray in interface java.util.Collection
Specified by:
toArray in interface java.util.List

add

public boolean add(java.lang.Object element)
Specified by:
add in interface java.util.Collection
Specified by:
add in interface java.util.List

remove

public boolean remove(java.lang.Object element)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.Collection
Specified by:
containsAll in interface java.util.List

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Collection
Specified by:
addAll in interface java.util.List

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Collection
Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Collection
Specified by:
retainAll in interface java.util.List

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List

indexOf

public int indexOf(java.lang.Object element)
Specified by:
indexOf in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object element)
Specified by:
lastIndexOf in interface java.util.List

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.lang.Iterable
Specified by:
iterator in interface java.util.Collection
Specified by:
iterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List

clear

public void clear()
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List


Copyright © 2002-2007 JRuby Team. All Rights Reserved.