Package org.jruby
Class RubyArray<T extends IRubyObject>
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyArray<T>
- 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
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static class
class
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
protected int
static final int
protected int
protected IRubyObject[]
Fields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR
Fields inherited from class org.jruby.RubyBasicObject
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, 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, 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, varTableStamp
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionRubyArray
(RubyClass klass, IRubyObject[] vals, boolean shared) protected
protected
RubyArray
(Ruby runtime, RubyClass klass, IRubyObject[] vals) RubyArray
(Ruby runtime, IRubyObject[] vals, int begin, int length) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
add
(ThreadContext context, Object element) boolean
addAll
(int index, Collection c) boolean
addAll
(Collection c) all_p
(ThreadContext context, Block block) all_p
(ThreadContext context, IRubyObject arg, Block block) all_pCommon
(ThreadContext context, IRubyObject arg, Block block) any_p
(ThreadContext context, Block block) any_p
(ThreadContext context, IRubyObject arg, Block block) any_pCommon
(ThreadContext context, IRubyObject arg, Block block) RubyArray
<?> append
(IRubyObject item) Deprecated.append
(ThreadContext context, IRubyObject item) rb_ary_push - specialized rb_ary_storearef
(IRubyObject arg0) Deprecated.aref
(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.aref
(IRubyObject arg0, IRubyObject arg1) Deprecated.aref
(ThreadContext context, IRubyObject arg0) rb_ary_arefaref
(ThreadContext context, IRubyObject arg0, IRubyObject arg1) Deprecated.aryAppend
(ThreadContext context, RubyArray<?> y) aryDup()
rb_ary_dupstatic RubyArray
aryToAry
(IRubyObject obj) Deprecated.static RubyArray
aryToAry
(ThreadContext context, IRubyObject obj) rb_ary_to_aryaset
(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.aset
(IRubyObject arg0, IRubyObject arg1) Deprecated.aset
(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) Deprecated.aset
(ThreadContext context, IRubyObject arg0, IRubyObject arg1) aset
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) rb_ary_asetassoc
(ThreadContext context, IRubyObject key) rb_ary_assocat
(IRubyObject pos) Deprecated.Useat(ThreadContext, IRubyObject)
instead.at
(ThreadContext context, IRubyObject pos) rb_ary_atbsearch
(ThreadContext context, Block block) bsearch_index
(ThreadContext context, Block block) rb_check_array_type Returns the result of trying to convert this object to an Array with "to_ary".protected static final void
checkLength
(Ruby runtime, long length) Deprecated.static final int
checkLength
(ThreadContext context, long length) void
clear()
collect
(ThreadContext context, Block block) collect_bang
(ThreadContext context, Block block) rb_ary_collect_bangcollectArray
(ThreadContext context, Block block) Collect the contents of this array after filtering through block, or return a new equivalent array if the block is not given (!isGiven()).collectBang
(ThreadContext context, Block block) rb_ary_collect_bangcollectEnum
(ThreadContext context) Produce a new enumerator that will filter the contents of this array usingcollectArray(ThreadContext, Block)
.combination
(ThreadContext context, IRubyObject num, Block block) rb_ary_combinationcompact()
Deprecated.compact
(ThreadContext context) Deprecated.compact_bang
(ThreadContext context) rb_ary_compact_bangcompare
(ThreadContext context, CallSite site, IRubyObject other) protected static int
compareFixnums
(RubyFixnum o1, RubyFixnum o2) protected static int
compareOthers
(ThreadContext context, IRubyObject o1, IRubyObject o2) concat
(IRubyObject obj) concat
(ThreadContext context, IRubyObject obj) rb_ary_concatconcat
(ThreadContext context, IRubyObject[] objs) rb_ary_concat_multiprotected final void
boolean
boolean
Tries to convert this object to a Ruby Array using the "to_ary" method.void
copyInto
(IRubyObject[] target, int start) Deprecated.void
copyInto
(IRubyObject[] target, int start, int len) Deprecated.void
copyInto
(ThreadContext context, IRubyObject[] target, int start) Copy the values contained in this array into the target array at the specified offset.void
copyInto
(ThreadContext context, IRubyObject[] target, int start, int len) Copy the specified number of values contained in this array into the target array at the specified offset.count
(ThreadContext context, Block block) count
(ThreadContext context, IRubyObject obj, Block block) static IRubyObject
create
(IRubyObject klass, IRubyObject[] args, Block block) Deprecated.static IRubyObject
create
(ThreadContext context, IRubyObject klass, IRubyObject[] args, Block block) rb_ary_s_createstatic RubyClass
createArrayClass
(ThreadContext context, RubyClass Object, RubyModule Enumerable) cycle
(ThreadContext context, Block block) rb_ary_cyclecycle
(ThreadContext context, IRubyObject arg, Block block) rb_ary_cycledeconstruct
(ThreadContext context) delete
(ThreadContext context, IRubyObject item, Block block) rb_ary_deletedelete_at
(int pos) Deprecated.delete_at
(IRubyObject obj) Deprecated.delete_at
(ThreadContext context, int pos) rb_ary_delete_atdelete_at
(ThreadContext context, IRubyObject obj) rb_ary_delete_at_mdelete_if
(ThreadContext context, Block block) deleteIf
(ThreadContext context, Block block) rb_ary_delete_ifdetectCommon
(ThreadContext context, IRubyObject ifnone, Block block) difference
(ThreadContext context, IRubyObject[] args) rb_ary_difference_multidig
(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) drop
(ThreadContext context, IRubyObject n) rb_ary_takedrop_while
(ThreadContext context, Block block) rb_ary_take_whiledup()
Overridden dup for fast-path logic.protected RubyArray
each
(ThreadContext context, Block block) mri: rb_ary_eacheach_index
(ThreadContext context, Block block) each_slice
(ThreadContext context, IRubyObject arg, Block block) eachIndex
(ThreadContext context, Block block) rb_ary_each_indexeachSlice
(ThreadContext context, int size, Block block) eltInternal
(int offset) eltInternalSet
(int offset, T item) eltOk
(long offset) empty_p()
Deprecated.empty_p
(ThreadContext context) rb_ary_empty_pvoid
ensureCapacity
(int minCapacity) Deprecated.final IRubyObject
entry
(int offset) final IRubyObject
entry
(long offset) rb_ary_entryeql
(ThreadContext context, IRubyObject obj) rb_ary_eqlboolean
This override does not do a "checked" dispatch.fetch
(ThreadContext context, IRubyObject[] args, Block block) Deprecated.Use the versions with zero, one, or two args.fetch
(ThreadContext context, IRubyObject arg0, Block block) rb_ary_fetchfetch
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) rb_ary_fetchfetch_values
(ThreadContext context, IRubyObject[] args, Block block) fill
(ThreadContext context, Block block) fill
(ThreadContext context, IRubyObject arg, Block block) fill
(ThreadContext context, IRubyObject arg1, IRubyObject arg2, Block block) fill
(ThreadContext context, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) protected IRubyObject
fillCommon
(ThreadContext context, int beg, long len, Block block) protected IRubyObject
fillCommon
(ThreadContext context, int beg, long len, IRubyObject item) find
(ThreadContext context, IRubyObject ifnone, Block block) find_index
(ThreadContext context, Block block) find_index
(ThreadContext context, IRubyObject cond) first()
Deprecated.first
(IRubyObject arg0) Deprecated.first
(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.first
(ThreadContext context) first
(ThreadContext context, IRubyObject arg0) flatten
(ThreadContext context) protected boolean
flatten
(ThreadContext context, int level, RubyArray result) flatten
(ThreadContext context, IRubyObject arg) flatten_bang
(ThreadContext context) flatten_bang
(ThreadContext context, IRubyObject arg) frozen_p
(ThreadContext context) rb_ary_frozen_pget
(int index) Will return the Java interface that most closely can represent this object, when working through Java integration translations.int
final List
<IRubyObject> getList()
Deprecated.RubyArray implements List, use it directlyThis is overridden in the other concrete Java builtins to provide a fast way to determine what type they are.hash
(ThreadContext context) rb_ary_hashinclude_p
(ThreadContext context, IRubyObject item) rb_ary_includesboolean
includes
(ThreadContext context, IRubyObject item) boolean
includesByEql
(ThreadContext context, IRubyObject item) index
(ThreadContext context, Block block) index
(ThreadContext context, IRubyObject obj) rb_ary_indexindex
(ThreadContext context, IRubyObject obj, Block unused) indexes
(IRubyObject[] args) Deprecated.indexes
(ThreadContext context, IRubyObject[] args) Deprecated.int
initialize
(ThreadContext context, Block block) rb_ary_initializeinitialize
(ThreadContext context, IRubyObject[] args, Block block) Deprecated.Use the versions with zero, one, or two args.initialize
(ThreadContext context, IRubyObject arg0, Block block) rb_ary_initializeinitialize
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) rb_ary_initializeinitialize_copy
(ThreadContext context, IRubyObject orig) rb_ary_initialize_copyprotected IRubyObject
initializeCommon
(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) insert()
insert
(IRubyObject arg) Deprecated.insert
(IRubyObject[] args) Deprecated.insert
(IRubyObject arg1, IRubyObject arg2) Deprecated.insert
(ThreadContext context, IRubyObject arg) rb_ary_insertinsert
(ThreadContext context, IRubyObject[] args) insert
(ThreadContext context, IRubyObject arg1, IRubyObject arg2) inspect
(ThreadContext context) rb_ary_inspectprotected IRubyObject
inspectAry
(ThreadContext context) inspect_aryprotected IRubyObject
internalRotate
(ThreadContext context, int cnt) protected IRubyObject
internalRotateBang
(ThreadContext context, int cnt) intersect_p
(ThreadContext context, IRubyObject other) MRI: rb_ary_intersect_pintersection
(ThreadContext context, IRubyObject[] args) boolean
isEmpty()
boolean
isSharedJavaArray
(RubyArray other) iterator()
join
(ThreadContext context) join
(ThreadContext context, IRubyObject sep) rb_ary_joinjoin19
(ThreadContext context) Deprecated.join19
(ThreadContext context, IRubyObject sep) Deprecated.protected int
joinStrings
(RubyString sep, int max, RubyString result) keep_if
(ThreadContext context, Block block) last()
Deprecated.last
(IRubyObject arg0) Deprecated.last
(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.last
(ThreadContext context) last
(ThreadContext context, IRubyObject arg0) rb_ary_lastint
lastIndexOf
(Object element) length()
Deprecated.length
(ThreadContext context) rb_ary_lengthlistIterator
(int index) protected RubyArray
<?> rb_ary_make_sharedmap
(ThreadContext context, Block block) map_bang
(ThreadContext context, Block block) rb_ary_collect_bangstatic void
marshalTo
(RubyArray array, MarshalStream output) Deprecated, for removal: This API element is subject to removal in a future version.static void
marshalTo
(ThreadContext context, RubyArray array, MarshalStream output) Deprecated, for removal: This API element is subject to removal in a future version.static void
marshalTo
(ThreadContext context, RubyOutputStream out, RubyArray array, MarshalDumper output) max
(ThreadContext context, Block block) max
(ThreadContext context, IRubyObject num, Block block) min
(ThreadContext context, Block block) min
(ThreadContext context, IRubyObject num, Block block) minmax
(ThreadContext context, Block block) protected void
modify()
Deprecated.protected void
modify
(ThreadContext context) rb_ary_modifyprotected final void
Deprecated.protected final void
modifyCheck
(ThreadContext context) rb_ary_modify_checkstatic final RubyArray
<?> Deprecated.static final RubyArray
<?> static final RubyArray
Deprecated.UseCreate.allocArray(ThreadContext, int)
insteadstatic RubyArray
<?> newArray
(Ruby runtime, Collection<? extends IRubyObject> collection) static RubyArray
<?> newArray
(Ruby runtime, List<? extends IRubyObject> list) static RubyArray
<?> newArray
(Ruby runtime, IRubyObject obj) static RubyArray
<?> newArray
(Ruby runtime, IRubyObject[] args) rb_ary_new4, rb_ary_new3static RubyArray
<?> newArray
(Ruby runtime, IRubyObject car, IRubyObject cdr) rb_assoc_newstatic RubyArray
<?> newArray
(Ruby runtime, IRubyObject first, IRubyObject second, IRubyObject third) static RubyArray
<?> newArray
(Ruby runtime, IRubyObject first, IRubyObject second, IRubyObject third, IRubyObject fourth) static final RubyArray
<?> newArray
(ThreadContext context) rb_ary_newstatic final RubyArray
<?> newArray
(ThreadContext context, int len) static final RubyArray
<?> newArrayLight
(Ruby runtime) rb_ary_newstatic RubyArray
<?> newArrayLight
(RubyClass arrayClass, IRubyObject obj) static RubyArray
<?> newArrayLight
(RubyClass arrayClass, IRubyObject car, IRubyObject cdr) static final RubyArray
<?> newArrayLight
(Ruby runtime, int len) static final RubyArray
<?> newArrayLight
(Ruby runtime, long len) Deprecated.static RubyArray
<?> newArrayLight
(Ruby runtime, IRubyObject obj) static RubyArray
<?> newArrayLight
(Ruby runtime, IRubyObject... objs) static RubyArray
<?> newArrayLight
(Ruby runtime, IRubyObject car, IRubyObject cdr) static RubyArray
newArrayMayCopy
(Ruby runtime, IRubyObject... args) static RubyArray
newArrayMayCopy
(Ruby runtime, IRubyObject[] args, int start) static RubyArray
newArrayMayCopy
(Ruby runtime, IRubyObject[] args, int start, int length) Construct a new RubyArray given the specified range of elements in the source array.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
newBlankArray
(Ruby runtime, int size) Deprecated.static RubyArray
newBlankArray
(ThreadContext context, int size) Construct the most efficient array shape for the given size.static RubyArray
<?> newEmptyArray
(Ruby runtime) static RubyArray
<?> newEmptyArray
(Ruby runtime, RubyClass klass) static RubyArray
<?> newSharedArray
(RubyClass arrayClass, IRubyObject[] shared) nitems()
Deprecated.nitems
(ThreadContext context) rb_ary_nitemsnone_p
(ThreadContext context, Block block) none_p
(ThreadContext context, IRubyObject arg, Block block) none_pCommon
(ThreadContext context, IRubyObject arg, Block block) one_p
(ThreadContext context, Block block) one_p
(ThreadContext context, IRubyObject arg, Block block) one_pCommon
(ThreadContext context, IRubyObject arg, Block block) op_and
(IRubyObject other) Deprecated.op_and
(ThreadContext context, IRubyObject other) MRI: rb_ary_andop_cmp
(ThreadContext context, IRubyObject obj) rb_ary_cmpop_diff
(IRubyObject other) Deprecated.op_diff
(ThreadContext context, IRubyObject other) rb_ary_diffop_equal
(ThreadContext context, IRubyObject obj) rb_ary_equalop_or
(IRubyObject other) Deprecated.op_or
(ThreadContext context, IRubyObject other) rb_ary_orop_plus
(IRubyObject obj) Deprecated.op_plus
(ThreadContext context, IRubyObject obj) rb_ary_plusop_times
(ThreadContext context, IRubyObject times) rb_ary_timespack
(ThreadContext context, IRubyObject obj) pack
(ThreadContext context, IRubyObject obj, IRubyObject maybeOpts) permutation
(ThreadContext context, Block block) permutation
(ThreadContext context, IRubyObject num, Block block) rb_ary_permutationpop
(ThreadContext context) rb_ary_poppop
(ThreadContext context, IRubyObject num) product
(ThreadContext context, IRubyObject[] args) rb_ary_productproduct
(ThreadContext context, IRubyObject[] args, Block block) push
(IRubyObject item) Deprecated.RubyArray
<?> push
(IRubyObject[] items) Deprecated.push
(ThreadContext context, IRubyObject item) push
(ThreadContext context, IRubyObject[] items) RubyArray
<?> push_m
(IRubyObject[] items) Deprecated.rassoc
(ThreadContext context, IRubyObject value) rb_ary_rassocrb_clear()
Deprecated.rb_clear
(ThreadContext context) rb_ary_clearrbCollect
(ThreadContext context, Block block) rb_ary_collectreject
(ThreadContext context, Block block) reject_bang
(ThreadContext context, Block block) rejectBang
(ThreadContext context, Block block) final IRubyObject
rejectCommon
(ThreadContext context, Block block) rb_ary_reject_bangremove
(int index) boolean
boolean
repeated_permutation
(ThreadContext context, IRubyObject num, Block block) repeatedCombination
(ThreadContext context, IRubyObject num, Block block) replace
(IRubyObject orig) Deprecated.replace
(ThreadContext context, IRubyObject orig) rb_ary_replaceboolean
reverse()
Deprecated.reverse
(ThreadContext context) Deprecated.reverse_bang
(ThreadContext context) rb_ary_reverse_bangreverse_each
(ThreadContext context, Block block) reverseEach
(ThreadContext context, Block block) rb_ary_reverse_eachrindex
(ThreadContext context, Block block) rindex
(ThreadContext context, IRubyObject obj) rb_ary_rindexrindex
(ThreadContext context, IRubyObject obj, Block unused) rotate
(ThreadContext context) rotate
(ThreadContext context, IRubyObject cnt) rotate_bang
(ThreadContext context) rotate_bang
(ThreadContext context, IRubyObject cnt) Returns a stream of each IRubyObjectprotected static IRubyObject
safeArraySet
(ThreadContext context, IRubyObject[] values, int i, IRubyObject value) protected RubyArray
sample
(ThreadContext context) sample
(ThreadContext context, IRubyObject sampleOrOpts) sample
(ThreadContext context, IRubyObject[] args) Deprecated.sample
(ThreadContext context, IRubyObject sample, IRubyObject opts) select
(ThreadContext context, Block block) select_bang
(ThreadContext context, Block block) selectCommon
(ThreadContext context, Block block) rb_ary_selectshift
(ThreadContext context) rb_ary_shiftshift
(ThreadContext context, IRubyObject num) shuffle
(ThreadContext context) shuffle
(ThreadContext context, IRubyObject opts) shuffle
(ThreadContext context, IRubyObject[] args) Deprecated.shuffle_bang
(ThreadContext context) shuffle_bang
(ThreadContext context, IRubyObject opts) shuffle_bang
(ThreadContext context, IRubyObject[] args) Deprecated.int
size()
protected static IRubyObject
size
(ThreadContext context, RubyArray self, IRubyObject[] args) A size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])
slice_bang
(IRubyObject arg0) Deprecated.slice_bang
(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.slice_bang
(IRubyObject arg0, IRubyObject arg1) Deprecated.slice_bang
(ThreadContext context, IRubyObject arg0) rb_ary_slice_bangslice_bang
(ThreadContext context, IRubyObject arg0, IRubyObject arg1) rb_ary_slice_bangsort
(ThreadContext context, Block block) rb_ary_sortsort_bang
(ThreadContext context, Block block) rb_ary_sort_bangsort_by_bang
(ThreadContext context, Block block) rb_ary_sort_by_bangprotected IRubyObject
sortInternal
(ThreadContext context, boolean honorOverride) protected IRubyObject
sortInternal
(ThreadContext context, Block block) store
(long index, IRubyObject value) store
(ThreadContext context, long index, IRubyObject value) Store an element at the specified index or throw if the index is invalid.protected void
storeInternal
(ThreadContext context, int index, IRubyObject value) subList
(int fromIndex, int toIndex) subseq
(long beg, long len) rb_ary_subseqsubseq_step
(ThreadContext context, RubyArithmeticSequence arg0) rb_ary_subseq_stepsubseqLight
(long beg, long len) rb_ary_subseqsum
(ThreadContext context, Block block) sum
(ThreadContext context, IRubyObject init, Block block) sumCommon
(ThreadContext context, IRubyObject init, Block block) take
(ThreadContext context, IRubyObject n) rb_ary_taketake_while
(ThreadContext context, Block block) rb_ary_take_whileto_a()
Deprecated.to_a
(ThreadContext context) rb_ary_to_ato_ary()
Deprecated.to_ary
(ThreadContext context) to_h
(ThreadContext context) Deprecated.to_h
(ThreadContext context, Block block) to_s
(ThreadContext context) rb_ary_to_sObject[]
toArray()
Object[]
<T> T
Convert the object to the specified Java class, if possible.Deprecated.UsetoJavaArray(ThreadContext)
instead.toJavaArray
(ThreadContext context) Return a Java array copy of the elements contained in this Array.Return a Java array of the elements contained in this array, possibly a new array object.Return a reference to this RubyArray's underlying Java array, if it is not shared with another RubyArray, or an exact copy of the relevant range otherwise.Deprecated.transpose
(ThreadContext context) rb_ary_transposestatic IRubyObject
try_convert
(ThreadContext context, IRubyObject self, IRubyObject arg) union
(ThreadContext context, IRubyObject[] args) rb_ary_union_multiuniq
(ThreadContext context) rb_ary_uniquniq
(ThreadContext context, Block block) uniq_bang
(ThreadContext context) rb_ary_uniq_banguniq_bang
(ThreadContext context, Block block) static RubyArray
unmarshalFrom
(UnmarshalStream input) Deprecated, for removal: This API element is subject to removal in a future version.static RubyArray
unmarshalFrom
(ThreadContext context, RubyInputStream in, MarshalLoader input) protected void
unpack
(ThreadContext context) Overridden by specialized arrays to fall back to IRubyObject[].unshift()
Deprecated.Useunshift(ThreadContext)
insteadunshift
(IRubyObject item) Deprecated.unshift
(IRubyObject[] items) Deprecated.unshift
(ThreadContext context) unshift
(ThreadContext context, IRubyObject item) rb_ary_unshiftunshift
(ThreadContext context, IRubyObject[] items) values_at
(IRubyObject[] args) Deprecated.values_at
(ThreadContext context, IRubyObject[] args) rb_values_atzip
(ThreadContext context, IRubyObject[] args, Block block) rb_ary_zipMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, finishObjectClass, hashCode, inspect, op_eqq, puts, specificEval, toRubyString, toString
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, compareTo, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, eql_p, equal_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, inspect, inspectHashCode, 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, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_match, op_not, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, singletonClass, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_s, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, hashCode, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Field Details
-
DEFAULT_INSPECT_STR_SIZE
public static final int DEFAULT_INSPECT_STR_SIZE- See Also:
-
ARRAY_DEFAULT_SIZE
public static final int ARRAY_DEFAULT_SIZE- See Also:
-
values
-
begin
protected int begin -
realLength
protected int realLength
-
-
Constructor Details
-
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
-
-
Method Details
-
createArrayClass
public static RubyClass createArrayClass(ThreadContext context, RubyClass Object, RubyModule Enumerable) -
getNativeClassIndex
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:
getNativeClassIndex
in interfaceCoreObjectType
- Overrides:
getNativeClassIndex
in classRubyObject
- Returns:
- the ClassIndex of the native type this object was constructed from
- See Also:
-
concurrentModification
protected final void concurrentModification() -
create
@Deprecated(since="10.0") public static IRubyObject create(IRubyObject klass, IRubyObject[] args, Block block) Deprecated. -
create
public static IRubyObject create(ThreadContext context, IRubyObject klass, IRubyObject[] args, Block block) rb_ary_s_create -
newArray
Deprecated.UseCreate.allocArray(ThreadContext, int)
insteadCreate array with specific allocated size -
newArrayLight
Deprecated. -
newArray
-
newArray
-
newArrayLight
-
newArray
Deprecated. -
newArray
rb_ary_new -
newArrayLight
rb_ary_new -
newArray
-
newArrayLight
-
newArrayLight
-
newArrayLight
-
newArrayLight
-
newArrayLight
-
newArray
rb_assoc_new -
newArray
public static RubyArray<?> newArray(Ruby runtime, IRubyObject first, IRubyObject second, IRubyObject third) -
newArray
public static RubyArray<?> newArray(Ruby runtime, IRubyObject first, IRubyObject second, IRubyObject third, IRubyObject fourth) -
newEmptyArray
-
newEmptyArray
-
newArray
rb_ary_new4, rb_ary_new3 -
newArray
-
newArray
-
newArrayMayCopy
- See Also:
-
newArrayMayCopy
- See Also:
-
newArrayMayCopy
Construct a new RubyArray given the specified range of elements in the source array. The elements may be copied into a new backing store, and therefore you should not expect future changes to the source array to be reflected. Conversely, you should not modify the array after passing it, since the contents may not be copied.- Parameters:
runtime
- the runtimeargs
- the argsstart
- start indexlength
- number of elements- Returns:
- an array referencing the given elements
-
newArrayNoCopy
-
newArrayNoCopy
-
newArrayNoCopy
-
newArrayNoCopyLight
-
unpack
Overridden by specialized arrays to fall back to IRubyObject[]. -
checkLength
Deprecated. -
checkLength
-
getList
Deprecated.RubyArray implements List, use it directly- Returns:
- a read-only copy of this list
-
getLength
public int getLength() -
toJavaArray
Deprecated.UsetoJavaArray(ThreadContext)
instead.- Returns:
- ""
-
toJavaArray
Return a Java array copy of the elements contained in this Array. This version always creates a new Java array that is exactly the length of the Array's elements.- Returns:
- a Java array with exactly the size and contents of this RubyArray's elements
-
toJavaArrayUnsafe
Return a reference to this RubyArray's underlying Java array, if it is not shared with another RubyArray, or an exact copy of the relevant range otherwise. This method is typically used to work with the underlying array directly, knowing that it is not shared and that all accesses must consider the begin offset.- Returns:
- The underlying Java array for this RubyArray, or a copy if that array is shared.
-
toJavaArrayMaybeUnsafe
Return a Java array of the elements contained in this array, possibly a new array object. Use this method to potentially avoid making a new array and copying elements when the Array does not view a subset of the underlying Java array.- Returns:
- a Java array with exactly the size and contents of this RubyArray's elements, possibly the actual underlying array.
-
modifyCheck
Deprecated. -
modifyCheck
rb_ary_modify_check -
modify
Deprecated. -
modify
rb_ary_modify -
initialize
@Deprecated(since="9.4-") 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
rb_ary_initialize -
initialize
rb_ary_initialize -
initialize
public IRubyObject initialize(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) rb_ary_initialize -
initializeCommon
protected IRubyObject initializeCommon(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) -
initialize_copy
rb_ary_initialize_copy- Overrides:
initialize_copy
in classRubyBasicObject
- Parameters:
context
- the thread contextorig
- the original- Returns:
- a copy unless the same thing
-
dup
Overridden dup for fast-path logic.- Specified by:
dup
in interfaceIRubyObject
- Overrides:
dup
in classRubyBasicObject
- Returns:
- A new RubyArray sharing the original backing store.
-
dupImpl
-
aryDup
rb_ary_dup -
replace
Deprecated. -
replace
rb_ary_replace -
to_s
rb_ary_to_s- Overrides:
to_s
in classRubyBasicObject
-
includes
-
includesByEql
-
hash
rb_ary_hash- Overrides:
hash
in classRubyBasicObject
- Parameters:
context
- the current thread context- Returns:
- the hash value
-
store
-
store
Store an element at the specified index or throw if the index is invalid.- Parameters:
context
- the current thread contextindex
- the offset to store the valuevalue
- the value to be stored- Returns:
- the value set
-
storeInternal
-
eltOk
-
eltSetOk
-
eltSetOk
-
entry
rb_ary_entry -
entry
-
eltInternal
-
eltInternalSet
-
fetch
@Deprecated(since="9.4-") 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_values
-
fetch
rb_ary_fetch -
fetch
rb_ary_fetch -
aryToAry
rb_ary_to_ary -
aryToAry
Deprecated. -
insert
-
insert
Deprecated. -
insert
rb_ary_insert -
insert
Deprecated. -
insert
-
insert
Deprecated. -
insert
-
transpose
Deprecated. -
transpose
rb_ary_transpose -
values_at
Deprecated. -
values_at
rb_values_at -
subseq
rb_ary_subseq -
subseq_step
rb_ary_subseq_step -
subseqLight
rb_ary_subseq -
subseq
-
length
rb_ary_length -
length
Deprecated. -
size
A size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])
- See Also:
-
append
Deprecated. -
append
rb_ary_push - specialized rb_ary_store -
push_m
Deprecated.rb_ary_push_m - instance method push -
push
Deprecated. -
push
-
push
Deprecated. -
push
-
pop
rb_ary_pop -
pop
-
shift
rb_ary_shift -
shift
-
unshift
Deprecated.Useunshift(ThreadContext)
instead- Returns:
- ""
-
unshift
-
unshift
Deprecated. -
unshift
rb_ary_unshift -
unshift
Deprecated. -
unshift
-
include_p
rb_ary_includes -
frozen_p
rb_ary_frozen_p- Overrides:
frozen_p
in classRubyBasicObject
-
aref
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
aref
Deprecated. -
aref
rb_ary_aref -
aref
Deprecated. -
aref
-
aset
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
aset
Deprecated. -
aset
-
aset
Deprecated.- Parameters:
arg0
-arg1
-arg2
-- Returns:
- ""
-
aset
public IRubyObject aset(ThreadContext context, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) rb_ary_aset -
at
Deprecated.Useat(ThreadContext, IRubyObject)
instead.- Parameters:
pos
-- Returns:
- ""
-
at
rb_ary_at -
concat
rb_ary_concat -
aryAppend
Deprecated. -
aryAppend
-
concat
rb_ary_concat_multi -
concat
-
inspectAry
inspect_ary -
inspect
rb_ary_inspect- Specified by:
inspect
in interfaceIRubyObject
- Overrides:
inspect
in classRubyBasicObject
-
first
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
first
Deprecated. -
first
-
first
Deprecated. -
first
-
last
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
last
Deprecated. -
last
-
last
Deprecated. -
last
rb_ary_last -
each
mri: rb_ary_each -
eachSlice
-
each_slice
-
eachIndex
rb_ary_each_index -
each_index
-
reverseEach
rb_ary_reverse_each -
reverse_each
-
joinStrings
-
join19
Deprecated. -
join
rb_ary_join -
join19
Deprecated. -
join
-
to_a
rb_ary_to_a- Overrides:
to_a
in classRubyBasicObject
-
to_ary
Deprecated. -
to_ary
-
to_h
Deprecated. -
to_h
-
convertToArray
Description copied from class:RubyBasicObject
Tries to convert this object to a Ruby Array using the "to_ary" method.- Specified by:
convertToArray
in interfaceIRubyObject
- Overrides:
convertToArray
in classRubyBasicObject
- Returns:
- array representation of this
-
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 interfaceIRubyObject
- Overrides:
checkArrayType
in classRubyBasicObject
- Returns:
- nil if type check failed
-
op_equal
rb_ary_equal- Specified by:
op_equal
in interfaceIRubyObject
- Overrides:
op_equal
in classRubyBasicObject
-
compare
-
eql
rb_ary_eql -
compact_bang
Deprecated.- Returns:
- ""
-
compact_bang
rb_ary_compact_bang -
compact
Deprecated. -
compact
-
empty_p
Deprecated. -
empty_p
rb_ary_empty_p -
rb_clear
Deprecated. -
rb_clear
rb_ary_clear -
fill
-
fill
-
fill
-
fill
public IRubyObject fill(ThreadContext context, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) -
fillCommon
-
fillCommon
-
index
rb_ary_index -
index
-
index
-
bsearch
-
bsearch_index
-
rindex
rb_ary_rindex -
rindex
-
rindex
-
indexes
Deprecated. -
indexes
Deprecated. -
reverse_bang
Deprecated. -
reverse_bang
rb_ary_reverse_bang -
reverse
Deprecated. -
reverse
-
safeReverse
-
collectArray
Collect the contents of this array after filtering through block, or return a new equivalent array if the block is not given (!isGiven()).- Parameters:
context
- the current contextblock
- a block for filtering or NULL_BLOCK- Returns:
- an array of the filtered or unfiltered results
-
collectEnum
Produce a new enumerator that will filter the contents of this array usingcollectArray(ThreadContext, Block)
.- Parameters:
context
- the current context- Returns:
- an enumerator that will filter results
-
collect
- See Also:
-
rbCollect
rb_ary_collect -
map
-
collectBang
rb_ary_collect_bang -
collect_bang
rb_ary_collect_bang -
map_bang
rb_ary_collect_bang -
selectCommon
rb_ary_select -
select
-
select_bang
-
keep_if
-
deconstruct
-
delete
rb_ary_delete -
delete_at
Deprecated. -
delete_at
rb_ary_delete_at -
delete_at
Deprecated. -
delete_at
rb_ary_delete_at_m -
rejectCommon
rb_ary_reject_bang -
reject
-
rejectBang
-
reject_bang
-
deleteIf
rb_ary_delete_if -
delete_if
-
zip
rb_ary_zip -
op_cmp
rb_ary_cmp- Overrides:
op_cmp
in classRubyBasicObject
-
slice_bang
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
slice_bang
Deprecated. -
slice_bang
rb_ary_slice_bang -
slice_bang
Deprecated. -
slice_bang
rb_ary_slice_bang -
assoc
rb_ary_assoc -
rassoc
rb_ary_rassoc -
flatten
-
flatten_bang
-
flatten_bang
-
flatten
-
flatten
-
count
-
count
-
nitems
rb_ary_nitems -
nitems
Deprecated. -
op_plus
Deprecated. -
op_plus
rb_ary_plus -
op_times
rb_ary_times -
uniq_bang
rb_ary_uniq_bang -
uniq_bang
-
uniq
rb_ary_uniq -
uniq
-
op_diff
Deprecated. -
op_diff
rb_ary_diff -
difference
rb_ary_difference_multi -
intersection
-
intersect_p
MRI: rb_ary_intersect_p -
op_and
Deprecated. -
op_and
MRI: rb_ary_and -
op_or
Deprecated. -
op_or
rb_ary_or -
union
rb_ary_union_multi -
sort
rb_ary_sort -
sort_bang
rb_ary_sort_bang -
sortInternal
-
compareFixnums
-
compareOthers
-
sortInternal
-
sort_by_bang
rb_ary_sort_by_bang -
take
rb_ary_take -
take_while
rb_ary_take_while -
drop
rb_ary_take -
drop_while
rb_ary_take_while -
cycle
rb_ary_cycle -
cycle
rb_ary_cycle -
product
rb_ary_product -
product
-
combination
rb_ary_combination -
repeatedCombination
-
permutation
rb_ary_permutation -
permutation
-
repeated_permutation
-
shuffle_bang
-
shuffle_bang
-
shuffle
-
shuffle
-
sample
-
sample
-
sample
-
internalRotateBang
-
internalRotate
-
rotate_bang
-
rotate_bang
-
rotate
-
rotate
-
all_p
-
all_p
-
all_pCommon
-
any_p
-
any_p
-
any_pCommon
-
none_p
-
none_p
-
none_pCommon
-
one_p
-
one_p
-
one_pCommon
-
sum
-
sum
-
sumCommon
-
find
-
find_index
-
find_index
-
detectCommon
-
marshalTo
@Deprecated(since="10.0", forRemoval=true) public static void marshalTo(RubyArray array, MarshalStream output) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
marshalTo
@Deprecated(since="10.0", forRemoval=true) public static void marshalTo(ThreadContext context, RubyArray array, MarshalStream output) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
marshalTo
public static void marshalTo(ThreadContext context, RubyOutputStream out, RubyArray array, MarshalDumper output) -
unmarshalFrom
@Deprecated(since="10.0", forRemoval=true) public static RubyArray unmarshalFrom(UnmarshalStream input) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.- Throws:
IOException
-
unmarshalFrom
public static RubyArray unmarshalFrom(ThreadContext context, RubyInputStream in, MarshalLoader input) -
newBlankArray
Deprecated. -
newBlankArray
Construct the most efficient array shape for the given size. This should only be used when you intend to populate all elements, since the packed arrays will be born with a nonzero size and would have to be unpacked to partially populate. We nil-fill all cases, to ensure nulls will never leak out if there's an unpopulated element or an index accessed before assignment.- Parameters:
context
- the current thread contextsize
- the size- Returns:
- a RubyArray shaped for the given size
-
try_convert
-
pack
-
pack
-
dig
-
dig
-
dig
-
dig
-
max
-
max
-
min
-
min
-
minmax
-
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 interfaceIRubyObject
- Overrides:
getJavaClass
in classRubyBasicObject
- Returns:
- the true Java class of this (Ruby) object
-
copyInto
Deprecated. -
copyInto
Copy the values contained in this array into the target array at the specified offset. It is expected that the target array is large enough to hold all necessary values. -
copyInto
Deprecated. -
copyInto
Copy the specified number of values contained in this array into the target array at the specified offset. It is expected that the target array is large enough to hold all necessary values. -
size
public int size()- Specified by:
size
in interfaceCollection<T extends IRubyObject>
- Specified by:
size
in interfaceList<T extends IRubyObject>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceCollection<T extends IRubyObject>
- Specified by:
isEmpty
in interfaceList<T extends IRubyObject>
-
contains
- Specified by:
contains
in interfaceCollection<T extends IRubyObject>
- Specified by:
contains
in interfaceList<T extends IRubyObject>
-
toArray
- Specified by:
toArray
in interfaceCollection<T extends IRubyObject>
- Specified by:
toArray
in interfaceList<T extends IRubyObject>
-
toArray
- Specified by:
toArray
in interfaceCollection<T extends IRubyObject>
- Specified by:
toArray
in interfaceList<T extends IRubyObject>
-
toJava
Description copied from interface:IRubyObject
Convert the object to the specified Java class, if possible.- Specified by:
toJava
in interfaceIRubyObject
- Overrides:
toJava
in classRubyBasicObject
- Type Parameters:
T
- type- Parameters:
target
- The target type to which the object should be converted.- Returns:
- java type
- See Also:
-
add
- Specified by:
add
in interfaceCollection<T extends IRubyObject>
- Specified by:
add
in interfaceList<T extends IRubyObject>
-
add
-
remove
- Specified by:
remove
in interfaceCollection<T extends IRubyObject>
- Specified by:
remove
in interfaceList<T extends IRubyObject>
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T extends IRubyObject>
- Specified by:
containsAll
in interfaceList<T extends IRubyObject>
-
addAll
- Specified by:
addAll
in interfaceCollection<T extends IRubyObject>
- Specified by:
addAll
in interfaceList<T extends IRubyObject>
-
addAll
- Specified by:
addAll
in interfaceList<T extends IRubyObject>
-
removeAll
- Specified by:
removeAll
in interfaceCollection<T extends IRubyObject>
- Specified by:
removeAll
in interfaceList<T extends IRubyObject>
-
retainAll
- Specified by:
retainAll
in interfaceCollection<T extends IRubyObject>
- Specified by:
retainAll
in interfaceList<T extends IRubyObject>
-
get
- Specified by:
get
in interfaceList<T extends IRubyObject>
-
set
- Specified by:
set
in interfaceList<T extends IRubyObject>
-
add
- Specified by:
add
in interfaceList<T extends IRubyObject>
-
remove
- Specified by:
remove
in interfaceList<T extends IRubyObject>
-
indexOf
- Specified by:
indexOf
in interfaceList<T extends IRubyObject>
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T extends IRubyObject>
-
iterator
- Specified by:
iterator
in interfaceCollection<T extends IRubyObject>
- Specified by:
iterator
in interfaceIterable<T extends IRubyObject>
- Specified by:
iterator
in interfaceList<T extends IRubyObject>
-
listIterator
- Specified by:
listIterator
in interfaceList<T extends IRubyObject>
-
listIterator
- Specified by:
listIterator
in interfaceList<T extends IRubyObject>
-
subList
- Specified by:
subList
in interfaceList<T extends IRubyObject>
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<T extends IRubyObject>
- Specified by:
clear
in interfaceList<T extends IRubyObject>
-
equals
Description copied from class:RubyObject
This override does not do a "checked" dispatch.- Specified by:
equals
in interfaceCollection<T extends IRubyObject>
- Specified by:
equals
in interfaceList<T extends IRubyObject>
- Overrides:
equals
in classRubyObject
- Parameters:
other
- object to compare- Returns:
- true if equals
- See Also:
-
safeArraySet
protected static IRubyObject safeArraySet(ThreadContext context, IRubyObject[] values, int i, IRubyObject value) -
ensureCapacity
Deprecated.Increases the capacity of thisArray
, if necessary.- Parameters:
minCapacity
- the desired minimum capacity of the internal array
-
to_a
Deprecated.- Overrides:
to_a
in classRubyBasicObject
-
shuffle
Deprecated. -
shuffle_bang
Deprecated. -
sample
Deprecated. -
rubyStream
Returns a stream of each IRubyObject- Returns:
-