Package org.jruby

Class RubyArray<T extends IRubyObject>

Type Parameters:
T - What array holds
All Implemented Interfaces:
Serializable, Cloneable, Comparable<IRubyObject>, Iterable, Collection, List, RandomAccess, SequencedCollection, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
Direct Known Subclasses:
RubyArraySpecialized, StringArraySet

public class RubyArray<T extends IRubyObject> extends RubyObject implements List, RandomAccess
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. Note: elt(long) is based on notion if we exceed precision by passing in a long larger than int (actually Integer.MAX - 8) then it will just return nil. Anything using eltOk must know this already to avoid an AIOOBE. We do catch that in eltOk but only as an attempt at detecting concurrent modifications to the length. So if you improperly use eltOk you will get a conc error and not AIOOBE. Guidance for elt(long) is that if the Ruby method should raise if it is too large then you need to do that before you call this (toLong vs getValue/asLong).
See Also: