Package org.jruby
Class RubyArray<T extends IRubyObject>
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyArray<T>
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,Iterable,Collection,List,RandomAccess,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.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface(package private) static classstatic classprivate static classclass(package private) final classNested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprotected intstatic final intprivate booleanprivate static final RubyArray.JoinRecursiveprotected intprivate static final intprivate static final intprivate static final intprivate static final booleanprotected IRubyObject[]Fields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields 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, UNTRUST_F, 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, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateprotectedprotectedprivateRubyArray(Ruby runtime, RubyClass klass, IRubyObject[] vals) privateRubyArray(Ruby runtime, RubyClass klass, IRubyObject[] vals, boolean objectspace) privateRubyArray(Ruby runtime, RubyClass metaClass, IRubyObject[] vals, int begin, int length, boolean objectSpace) privateRubyArray(Ruby runtime, IRubyObject[] vals) privateRubyArray(Ruby runtime, IRubyObject[] vals, boolean objectSpace) privateRubyArray(Ruby runtime, IRubyObject[] vals, int begin, int length) -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection c) booleanaddAll(Collection c) all_p(ThreadContext context, Block block) all_p(ThreadContext context, IRubyObject arg, Block block) private IRubyObjectall_pBlockless(ThreadContext context, IRubyObject pattern) all_pCommon(ThreadContext context, IRubyObject arg, Block block) private voidalloc(int length) any_p(ThreadContext context, Block block) any_p(ThreadContext context, IRubyObject arg, Block block) private IRubyObjectany_pBlockless(ThreadContext context, IRubyObject pattern) any_pCommon(ThreadContext context, IRubyObject arg, Block block) append(IRubyObject item) rb_ary_push - specialized rb_ary_storearef(IRubyObject arg0) rb_ary_arefaref(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.aref(IRubyObject arg0, IRubyObject arg1) aref19(IRubyObject arg0) Deprecated.aref19(IRubyObject arg0, IRubyObject arg1) Deprecated.private IRubyObjectarefCommon(IRubyObject arg0) private IRubyObjectarefCommon(IRubyObject arg0, IRubyObject arg1) aryDup()rb_ary_dupfinal RubyArrayaryDup19()Deprecated.private static voidaryReverse(IRubyObject[] _p1, int p1, IRubyObject[] _p2, int p2) static RubyArrayaryToAry(IRubyObject obj) Deprecated.static RubyArrayaryToAry(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) aset(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) rb_ary_asetaset19(IRubyObject arg0, IRubyObject arg1) Deprecated.aset19(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) Deprecated.private voidasetFallback(IRubyObject arg0, IRubyObject arg1) assoc(ThreadContext context, IRubyObject key) rb_ary_assocat(IRubyObject pos) rb_ary_atprivate static IRubyObjectbinomialCoefficient(ThreadContext context, long comb, long size) bsearch(ThreadContext context, Block block) bsearch_index(ThreadContext context, Block block) private intbsearch_index_internal(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 voidcheckLength(Ruby runtime, long length) choice(ThreadContext context) Deprecated.voidclear()private voidclearValues(int from, int to) private IRubyObjectcmpCommon(ThreadContext context, Ruby runtime, RubyArray ary2) collect(ThreadContext context, Block block) collect_bang(ThreadContext context, Block block) rb_ary_collect_bangcollect19(ThreadContext context, Block block) Deprecated.collectArray(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).private static voidcombinate(ThreadContext context, int len, int n, int[] stack, RubyArray values, Block block) combination(ThreadContext context, IRubyObject num, Block block) rb_ary_combinationprivate static IRubyObjectcombinationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A combination size method suitable for method reference implementation of SizeFnsize(ThreadContext, RubyArray, IRubyObject[]).compact()rb_ary_compactrb_ary_compact_bangDeprecated.compare(ThreadContext context, CallSite site, IRubyObject other) protected static intcompareFixnums(RubyFixnum o1, RubyFixnum o2) protected static intcompareOthers(ThreadContext context, IRubyObject o1, IRubyObject o2) Deprecated.private voidconcat(IRubyObject obj) concat(ThreadContext context, IRubyObject obj) rb_ary_concatconcat(ThreadContext context, IRubyObject[] objs) rb_ary_concat_multiconcat19(IRubyObject obj) Deprecated.protected final voidprivate static RuntimeExceptionconcurrentModification(Ruby runtime, Exception cause) booleanbooleanTries to convert this object to a Ruby Array using the "to_ary" method.voidcopyInto(IRubyObject[] target, int start) Copy the values contained in this array into the target array at the specified offset.voidcopyInto(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 IRubyObjectcreate(IRubyObject klass, IRubyObject[] args, Block block) rb_ary_s_createstatic RubyClasscreateArrayClass(Ruby runtime) cycle(ThreadContext context, Block block) rb_ary_cyclecycle(ThreadContext context, IRubyObject arg, Block block) rb_ary_cycleprivate IRubyObjectcycleCommon(ThreadContext context, long n, Block block) private static IRubyObjectcycleSize(ThreadContext context, RubyArray self, IRubyObject[] args) A cycle size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])delete(ThreadContext context, IRubyObject item, Block block) rb_ary_deletedelete_at(int pos) rb_ary_delete_atdelete_at(IRubyObject obj) rb_ary_delete_at_mdelete_if(ThreadContext context, Block block) deleteIf(ThreadContext context, Block block) rb_ary_delete_ifprivate static IRubyObjectdescendingFactorial(ThreadContext context, long from, long howMany) detectCommon(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 RubyArrayeach(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) private final IRubyObjectelt(long offset) rb_ary_elteltInternal(int offset) eltInternalSet(int offset, T item) eltOk(long offset) empty_p()rb_ary_empty_pvoidensureCapacity(int minCapacity) Deprecated.final IRubyObjectentry(int offset) final IRubyObjectentry(long offset) rb_ary_entryeql(ThreadContext context, IRubyObject obj) rb_ary_eqlbooleanThis 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_fetchfill(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) private intfillBegin(IRubyObject arg) protected IRubyObjectfillCommon(ThreadContext context, int beg, long len, Block block) protected IRubyObjectfillCommon(ThreadContext context, int beg, long len, IRubyObject item) private longfillLen(long beg, IRubyObject arg) find(ThreadContext context, IRubyObject ifnone, Block block) find_index(ThreadContext context, Block block) find_index(ThreadContext context, IRubyObject cond) first()rb_ary_firstfirst(IRubyObject arg0) rb_ary_firstfirst(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.flatten(ThreadContext context) protected booleanflatten(ThreadContext context, int level, RubyArray result) flatten(ThreadContext context, IRubyObject arg) flatten_bang(ThreadContext context) flatten_bang(ThreadContext context, IRubyObject arg) flatten_bang19(ThreadContext context) Deprecated.flatten_bang19(ThreadContext context, IRubyObject arg) Deprecated.flatten19(ThreadContext context) Deprecated.flatten19(ThreadContext context, IRubyObject arg) Deprecated.frozen_p(ThreadContext context) rb_ary_frozen_pget(int index) private intgetArg0Generation(CachingCallSite op_cmp) Will return the Java interface that most closely can represent this object, when working through Java integration translations.intfinal 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()rb_obj_id Will return the hash code of this object.hash(ThreadContext context) rb_ary_hashhash19(ThreadContext context) Deprecated.private longhashImpl(ThreadContext context) include_p(ThreadContext context, IRubyObject item) rb_ary_includesbooleanincludes(ThreadContext context, IRubyObject item) booleanincludesByEql(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) rb_ary_indexesintinitialize(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(IRubyObject orig) rb_ary_initialize_copyprotected IRubyObjectinitializeCommon(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block) insert()private voidinsert(long pos, IRubyObject val) insert(IRubyObject arg) rb_ary_insertinsert(IRubyObject[] args) insert(IRubyObject arg1, IRubyObject arg2) insert19(IRubyObject arg) Deprecated.insert19(IRubyObject[] args) Deprecated.insert19(IRubyObject arg1, IRubyObject arg2) Deprecated.inspect()rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj.inspect(ThreadContext context) rb_ary_inspectprotected IRubyObjectinspectAry(ThreadContext context) inspect_aryprotected IRubyObjectinternalRotate(ThreadContext context, int cnt) protected IRubyObjectinternalRotateBang(ThreadContext context, int cnt) booleanisEmpty()private static booleanisPackedArray(int size) private static booleanisPackedArray(Collection<? extends IRubyObject> collection) booleanisSharedJavaArray(RubyArray other) iterator()join(ThreadContext context) join(ThreadContext context, IRubyObject sep) rb_ary_joinjoin19(ThreadContext context) join19(ThreadContext context, IRubyObject sep) rb_ary_joinprivate RubyStringjoinAny(ThreadContext context, RubyString sep, int i, RubyString result, boolean[] first) protected RubyStringjoinStrings(RubyString sep, int max, RubyString result) keep_if(ThreadContext context, Block block) last()rb_ary_lastlast(IRubyObject arg0) rb_ary_lastlast(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.intlastIndexOf(Object element) length()rb_ary_lengthlistIterator(int index) private RubyHashary_make_hashprivate RubyHashprivate RubyHashmakeHash(ThreadContext context, RubyHash hash, Block block) private RubyHashmakeHash(ThreadContext context, Block block) protected RubyArrayrb_ary_make_sharedprivate final RubyArraymakeShared(int beg, int len, RubyArray sharedArray) private RubyArraymakeShared(int beg, int len, RubyClass klass) private RubyArraymakeSharedFirst(ThreadContext context, IRubyObject num, boolean last, RubyClass klass) ary_shared_firstmap(ThreadContext context, Block block) map_bang(ThreadContext context, Block block) rb_ary_collect_bangmap19(ThreadContext context, Block block) Deprecated.static voidmarshalTo(RubyArray array, MarshalStream output) max(ThreadContext context, Block block) max(ThreadContext context, IRubyObject num, Block block) private IRubyObjectmaxWithBlock(ThreadContext context, Block block) min(ThreadContext context, Block block) min(ThreadContext context, IRubyObject num, Block block) private IRubyObjectminWithBlock(ThreadContext context, Block block) protected voidmodify()rb_ary_modifyprotected final voidrb_ary_modify_checkstatic final RubyArrayrb_ary_newstatic final RubyArraystatic final RubyArrayrb_ary_new2static RubyArraynewArray(Ruby runtime, Collection<? extends IRubyObject> collection) static RubyArraynewArray(Ruby runtime, List<? extends IRubyObject> list) static RubyArraynewArray(Ruby runtime, IRubyObject obj) static RubyArraynewArray(Ruby runtime, IRubyObject[] args) rb_ary_new4, rb_ary_new3static RubyArraynewArray(Ruby runtime, IRubyObject car, IRubyObject cdr) rb_assoc_newstatic RubyArraynewArray(Ruby runtime, IRubyObject first, IRubyObject second, IRubyObject third) static RubyArraynewArray(Ruby runtime, IRubyObject first, IRubyObject second, IRubyObject third, IRubyObject fourth) static final RubyArraynewArrayLight(Ruby runtime) rb_ary_newstatic final RubyArraynewArrayLight(Ruby runtime, int len) static final RubyArraynewArrayLight(Ruby runtime, long len) static RubyArraynewArrayLight(Ruby runtime, IRubyObject obj) static RubyArraynewArrayLight(Ruby runtime, IRubyObject... objs) static RubyArraynewArrayLight(Ruby runtime, IRubyObject car, IRubyObject cdr) static RubyArraynewArrayMayCopy(Ruby runtime, IRubyObject... args) static RubyArraynewArrayMayCopy(Ruby runtime, IRubyObject[] args, int start) static RubyArraynewArrayMayCopy(Ruby runtime, IRubyObject[] args, int start, int length) Construct a new RubyArray given the specified range of elements in the source array.static RubyArraynewArrayNoCopy(Ruby runtime, IRubyObject... args) static RubyArraynewArrayNoCopy(Ruby runtime, IRubyObject[] args, int begin) static RubyArraynewArrayNoCopy(Ruby runtime, IRubyObject[] args, int begin, int length) static RubyArraynewArrayNoCopyLight(Ruby runtime, IRubyObject[] args) static RubyArraynewBlankArray(Ruby runtime, int size) Construct the most efficient array shape for the given size.(package private) static RubyArraynewBlankArrayInternal(Ruby runtime, int size) (package private) static RubyArraynewBlankArrayInternal(Ruby runtime, RubyClass metaClass, int size) static RubyArraynewEmptyArray(Ruby runtime) static RubyArraynewEmptyArray(Ruby runtime, RubyClass klass) nitems()rb_ary_nitemsnone_p(ThreadContext context, Block block) none_p(ThreadContext context, IRubyObject arg, Block block) private IRubyObjectnone_pBlockless(ThreadContext context, IRubyObject pattern) none_pCommon(ThreadContext context, IRubyObject arg, Block block) one_p(ThreadContext context, Block block) one_p(ThreadContext context, IRubyObject arg, Block block) private IRubyObjectone_pBlockless(ThreadContext context, IRubyObject pattern) one_pCommon(ThreadContext context, IRubyObject arg, Block block) op_and(IRubyObject other) rb_ary_andop_cmp(ThreadContext context, IRubyObject obj) rb_ary_cmpop_diff(IRubyObject other) rb_ary_diffop_equal(ThreadContext context, IRubyObject obj) rb_ary_equalop_or(IRubyObject other) rb_ary_orop_plus(IRubyObject obj) rb_ary_plusop_times(ThreadContext context, IRubyObject times) rb_ary_timesop_times19(ThreadContext context, IRubyObject times) Deprecated.private static final intoptimizedCmp(ThreadContext context, IRubyObject a, IRubyObject b, int token, CachingCallSite op_cmp, CallSite op_gt, CallSite op_lt) pack(ThreadContext context, IRubyObject obj) pack(ThreadContext context, IRubyObject obj, IRubyObject maybeOpts) private static RubyArraypackedArray(Ruby runtime, List<? extends IRubyObject> args) private static RubyArraypackedArray(Ruby runtime, IRubyObject[] args) permutation(ThreadContext context, Block block) permutation(ThreadContext context, IRubyObject num, Block block) rb_ary_permutationprivate IRubyObjectpermutationCommon(ThreadContext context, int r, boolean repeat, Block block) private static IRubyObjectpermutationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A permutation size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])private static voidpermute(ThreadContext context, int n, int r, int[] p, boolean[] used, RubyArray values, Block block) pop(ThreadContext context) rb_ary_poppop(ThreadContext context, IRubyObject num) product(ThreadContext context, IRubyObject[] args) rb_ary_productproduct(ThreadContext context, IRubyObject[] args, Block block) product19(ThreadContext context, IRubyObject[] args, Block block) Deprecated.push(IRubyObject item) push(IRubyObject[] items) push_m(IRubyObject[] items) Deprecated.push_m19(IRubyObject[] items) Deprecated.rassoc(ThreadContext context, IRubyObject value) rb_ary_rassocrb_clear()rb_ary_clearrbCollect(ThreadContext context, Block block) rb_ary_collectprivate static voidrcombinate(ThreadContext context, int n, int r, int[] p, RubyArray values, Block block) private voidrealloc(int newLength, int valuesLength) private voidrecursiveJoin(ThreadContext context, IRubyObject outValue, RubyString sep, RubyString result, RubyArray ary, boolean[] first) reject(ThreadContext context, Block block) reject_bang(ThreadContext context, Block block) rejectBang(ThreadContext context, Block block) final IRubyObjectrejectCommon(ThreadContext context, Block block) rb_ary_reject_bangremove(int index) booleanbooleanrepeated_permutation(ThreadContext context, IRubyObject num, Block block) repeatedCombination(ThreadContext context, IRubyObject num, Block block) private static IRubyObjectrepeatedCombinationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A repeated combination size method suitable for method reference implementation of SizeFnsize(ThreadContext, RubyArray, IRubyObject[]).private static IRubyObjectrepeatedPermutationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A repeated permutation size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])replace(IRubyObject orig) rb_ary_replacebooleanreverse()rb_ary_reverse_mrb_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) private static introtateCount(int cnt, int len) private static voidrpermute(ThreadContext context, int n, int r, int[] p, RubyArray values, Block block) private static voidsafeArrayCopy(Ruby runtime, IRubyObject[] source, int sourceStart, IRubyObject[] target, int targetStart, int length) private voidsafeArrayCopy(IRubyObject[] source, int sourceStart, IRubyObject[] target, int targetStart, int length) private static IRubyObjectsafeArrayRef(Ruby runtime, IRubyObject[] values, int i) private static IRubyObjectsafeArrayRefCondSet(Ruby runtime, IRubyObject[] values, int i, boolean doSet, IRubyObject value) private static IRubyObjectsafeArrayRefSet(Ruby runtime, IRubyObject[] values, int i, IRubyObject value) protected static IRubyObjectsafeArraySet(Ruby runtime, IRubyObject[] values, int i, IRubyObject value) private IRubyObjectsafeArraySet(IRubyObject[] values, int i, IRubyObject value) protected RubyArraysample(ThreadContext context) sample(ThreadContext context, IRubyObject sampleOrOpts) sample(ThreadContext context, IRubyObject[] args) Deprecated.sample(ThreadContext context, IRubyObject sample, IRubyObject opts) private IRubyObjectsampleCommon(ThreadContext context, IRubyObject randgen) Common sample logic when no sample size was specified.private IRubyObjectsampleCommon(ThreadContext context, IRubyObject sample, IRubyObject randgen) Common sample logic when a sample size was specified.select(ThreadContext context, Block block) select_bang(ThreadContext context, Block block) private voidselectBangEnsure(Ruby runtime, int len, int beg, int i1, int i2) selectCommon(ThreadContext context, Block block) rb_ary_selectprivate voidsetValuesFrom(ThreadContext context, RubyHash hash) shift(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.private IRubyObjectshuffleBang(ThreadContext context, IRubyObject randgen) private static JavaSites.ArraySitessites(ThreadContext context) intsize()protected static IRubyObjectsize(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) rb_ary_slice_bangslice_bang(IRubyObject[] args) Deprecated.Use the versions with zero, one, or two args.slice_bang(IRubyObject arg0, IRubyObject arg1) rb_ary_slice_bangprivate IRubyObjectslice_internal(Ruby runtime, int pos, int len) sort(ThreadContext context, Block block) rb_ary_sortsort_bang(ThreadContext context, Block block) rb_ary_sort_bangsort_bang19(ThreadContext context, Block block) Deprecated.sort_by_bang(ThreadContext context, Block block) rb_ary_sort_by_bangsort19(ThreadContext context, Block block) Deprecated.protected IRubyObjectsortInternal(ThreadContext context, boolean honorOverride) protected IRubyObjectsortInternal(ThreadContext context, Block block) private voidrb_ary_spliceprivate voidsplice(Ruby runtime, int beg, int len, IRubyObject rpl) private final voidspliceOne(long beg, IRubyObject rpl) rb_ary_spliceprivate voidspliceRealloc(int length, int valuesLength) store(long index, IRubyObject value) rb_ary_storeprotected voidstoreInternal(int index, IRubyObject value) private voidstoreRealloc(int index, int valuesLength) private static voidstrJoin(RubyString result, RubyString val, boolean[] first) subList(int fromIndex, int toIndex) subseq(long beg, long len) rb_ary_subseqsubseqLight(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()to_h(ThreadContext context) Deprecated.to_h(ThreadContext context, Block block) to_s()rb_any_to_s call-seq: obj.to_s => string Returns a string representing obj.to_s(ThreadContext context) rb_ary_to_sObject[]toArray()Object[]<T> TConvert the object to the specified Java class, if possible.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.rb_ary_transposestatic IRubyObjecttry_convert(ThreadContext context, IRubyObject self, IRubyObject arg) union(ThreadContext context, IRubyObject[] args) rb_ary_union_multiprivate voidunionInternal(ThreadContext context, RubyArray... args) rb_ary_unionuniq(ThreadContext context) rb_ary_uniquniq(ThreadContext context, Block block) uniq_bang(ThreadContext context) rb_ary_uniq_banguniq_bang(ThreadContext context, Block block) uniq_bang19(ThreadContext context, Block block) Deprecated.uniq19(ThreadContext context, Block block) Deprecated.static RubyArrayunmarshalFrom(UnmarshalStream input) protected voidunpack()Overridden by specialized arrays to fall back to IRubyObject[].unshift()unshift(IRubyObject item) rb_ary_unshiftunshift(IRubyObject[] items) Deprecated.unshift19(IRubyObject item) Deprecated.unshift19(IRubyObject[] items) Deprecated.private voidunshiftRealloc(int valuesLength) values_at(IRubyObject[] args) rb_values_atprivate static voidyieldValues(ThreadContext context, int r, int[] p, int pStart, RubyArray values, Block block) zip(ThreadContext context, IRubyObject[] args, Block block) rb_ary_zipprivate IRubyObjectzipCommon(ThreadContext context, IRubyObject[] args, Block block, RubyArray.ArgumentVisitor visitor) Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, hashCode, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, defaultToJava, display, ensureInstanceVariablesSettable, eql, eql_p, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, infectBy, infectBy, initialize, initialize19, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval19, instance_eval19, instance_eval19, instance_eval19, instance_exec, instance_exec19, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, instance_variables19, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method, method_missing, method_missing19, method19, methods, methods, methods19, methodsImpl, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_equal_19, op_match, op_match19, op_not, op_not_equal, op_not_match, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, rbClone, rbInspect, recacheBuiltinMethods, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respond_to_p, respond_to_p19, respond_to_p19, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, send19, send19, send19, send19, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method_added, singleton_method_added19, singleton_method_removed, singleton_method_removed19, singleton_method_undefined, singleton_method_undefined19, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted, tainted_p, testFrozen, testFrozen, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
hashCode, replaceAll, sort, spliterator
-
Field Details
-
DEFAULT_INSPECT_STR_SIZE
public static final int DEFAULT_INSPECT_STR_SIZE- See Also:
-
USE_PACKED_ARRAYS
private static final boolean USE_PACKED_ARRAYS -
ARRAY_DEFAULT_SIZE
public static final int ARRAY_DEFAULT_SIZE- See Also:
-
TMPLOCK_ARR_F
private static final int TMPLOCK_ARR_F- See Also:
-
TMPLOCK_OR_FROZEN_ARR_F
private static final int TMPLOCK_OR_FROZEN_ARR_F -
values
-
begin
protected int begin -
realLength
protected int realLength -
SORTED_THRESHOLD
private static final int SORTED_THRESHOLD- See Also:
-
JOIN_RECURSIVE
-
-
Constructor Details
-
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
private RubyArray(Ruby runtime, RubyClass metaClass, IRubyObject[] vals, int begin, int length, boolean objectSpace) -
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
-
RubyArray
-
-
Method Details
-
createArrayClass
-
getNativeClassIndex
Description copied from class:RubyObjectThis 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:
getNativeClassIndexin interfaceCoreObjectType- Overrides:
getNativeClassIndexin classRubyObject- See Also:
-
concurrentModification
protected final void concurrentModification() -
concurrentModification
-
create
rb_ary_s_create -
newArray
rb_ary_new2 -
newArrayLight
-
newArray
-
newArrayLight
-
newArray
rb_ary_new -
newArrayLight
rb_ary_new -
newArray
-
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
-
packedArray
-
packedArray
-
isPackedArray
private static boolean isPackedArray(int size) -
isPackedArray
-
newArrayMayCopy
-
newArrayMayCopy
-
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
protected void unpack()Overridden by specialized arrays to fall back to IRubyObject[]. -
alloc
private void alloc(int length) -
realloc
private void realloc(int newLength, int valuesLength) -
checkLength
-
getList
Deprecated.RubyArray implements List, use it directly- Returns:
- a read-only copy of this list
-
getLength
public int getLength() -
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
protected final void modifyCheck()rb_ary_modify_check -
modify
protected void modify()rb_ary_modify -
initialize
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_copyin classRubyBasicObject
-
dup
Overridden dup for fast-path logic.- Specified by:
dupin interfaceIRubyObject- Overrides:
dupin classRubyBasicObject- Returns:
- A new RubyArray sharing the original backing store.
-
dupImpl
-
aryDup
rb_ary_dup -
replace
rb_ary_replace -
to_s
rb_ary_to_s -
to_s
Description copied from class:RubyBasicObjectrb_any_to_s call-seq: obj.to_s => string Returns a string representing obj. The defaultto_sprints the object's class and an encoding of the object id. As a special case, the top-level object that is the initial execution context of Ruby programs returns ``main.''- Overrides:
to_sin classRubyBasicObject
-
includes
-
includesByEql
-
hash19
Deprecated. -
hash
Description copied from class:RubyBasicObjectrb_obj_id Will return the hash code of this object. In comparison to MRI, this method will use the Java identity hash code instead of using rb_obj_id, since the usage of id in JRuby will incur the cost of some. ObjectSpace maintenance.- Overrides:
hashin classRubyBasicObject
-
hash
rb_ary_hash -
hashImpl
-
store
rb_ary_store -
storeInternal
-
storeRealloc
private void storeRealloc(int index, int valuesLength) -
elt
rb_ary_elt -
eltOk
-
eltSetOk
-
eltSetOk
-
entry
rb_ary_entry -
entry
-
eltInternal
-
eltInternalSet
-
fetch
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
fetch
rb_ary_fetch -
fetch
rb_ary_fetch -
aryToAry
rb_ary_to_ary -
aryToAry
Deprecated. -
splice
-
splice
rb_ary_splice -
spliceOne
rb_ary_splice -
spliceRealloc
private void spliceRealloc(int length, int valuesLength) -
unshiftRealloc
private void unshiftRealloc(int valuesLength) -
insert
-
insert
rb_ary_insert -
insert19
Deprecated. -
insert
-
insert
-
insert19
Deprecated. -
insert
-
insert19
Deprecated. -
transpose
rb_ary_transpose -
values_at
rb_values_at -
subseq
rb_ary_subseq -
subseqLight
rb_ary_subseq -
subseq
-
length
rb_ary_length -
size
A size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[]) -
append
rb_ary_push - specialized rb_ary_store -
push_m
Deprecated.rb_ary_push_m - instance method push -
push
-
push
-
push_m19
Deprecated. -
pop
rb_ary_pop -
pop
-
shift
rb_ary_shift -
shift
-
unshift
-
unshift19
Deprecated. -
unshift
rb_ary_unshift -
unshift19
Deprecated. -
unshift
-
unshift19
Deprecated. -
include_p
rb_ary_includes -
frozen_p
rb_ary_frozen_p- Overrides:
frozen_pin classRubyBasicObject
-
aref
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
aref
rb_ary_aref -
aref19
Deprecated. -
arefCommon
-
aref
-
aref19
Deprecated. -
arefCommon
-
aset
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
aset
-
asetFallback
-
aset19
Deprecated. -
aset
rb_ary_aset -
aset19
Deprecated. -
at
rb_ary_at -
concat
rb_ary_concat -
concat
-
aryAppend
-
concat
rb_ary_concat_multi -
concat
-
concat19
Deprecated. -
inspectAry
inspect_ary -
inspect
rb_ary_inspect -
inspect
Description copied from class:RubyBasicObjectrb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject- Returns:
- String
-
first
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
first
rb_ary_first -
first
rb_ary_first -
last
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
last
rb_ary_last -
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
-
join
rb_ary_join -
join
-
joinStrings
-
joinAny
private RubyString joinAny(ThreadContext context, RubyString sep, int i, RubyString result, boolean[] first) -
strJoin
-
recursiveJoin
private void recursiveJoin(ThreadContext context, IRubyObject outValue, RubyString sep, RubyString result, RubyArray ary, boolean[] first) -
join19
rb_ary_join -
join19
-
to_a
rb_ary_to_a- Overrides:
to_ain classRubyBasicObject
-
to_ary
-
to_h
Deprecated. -
to_h
-
convertToArray
Description copied from class:RubyBasicObjectTries to convert this object to a Ruby Array using the "to_ary" method.- Specified by:
convertToArrayin interfaceIRubyObject- Overrides:
convertToArrayin classRubyBasicObject- Returns:
- array representation of this
-
checkArrayType
Description copied from class:RubyBasicObjectrb_check_array_type Returns the result of trying to convert this object to an Array with "to_ary".- Specified by:
checkArrayTypein interfaceIRubyObject- Overrides:
checkArrayTypein classRubyBasicObject- Returns:
- nil if type check failed
-
op_equal
rb_ary_equal- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
compare
-
eql
rb_ary_eql -
compact_bang
rb_ary_compact_bang -
compact
rb_ary_compact -
compact19
Deprecated. -
empty_p
rb_ary_empty_p -
rb_clear
rb_ary_clear -
fill
-
fill
-
fill
-
fill
public IRubyObject fill(ThreadContext context, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) -
fillBegin
-
fillLen
-
fillCommon
-
fillCommon
-
index
rb_ary_index -
index
-
index
-
bsearch
-
bsearch_index
-
bsearch_index_internal
-
rindex
rb_ary_rindex -
rindex
-
rindex
-
indexes
rb_ary_indexes -
reverse_bang
rb_ary_reverse_bang -
reverse
rb_ary_reverse_m -
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
-
delete
rb_ary_delete -
delete_at
rb_ary_delete_at -
delete_at
rb_ary_delete_at_m -
rejectCommon
rb_ary_reject_bang -
reject
-
rejectBang
-
selectBangEnsure
-
reject_bang
-
deleteIf
rb_ary_delete_if -
delete_if
-
zip
rb_ary_zip -
zipCommon
private IRubyObject zipCommon(ThreadContext context, IRubyObject[] args, Block block, RubyArray.ArgumentVisitor visitor) -
op_cmp
rb_ary_cmp- Overrides:
op_cmpin classRubyBasicObject
-
cmpCommon
-
slice_bang
Deprecated.Use the versions with zero, one, or two args.Variable arity version for compatibility. Not bound to a Ruby method. -
slice_internal
-
slice_bang
rb_ary_slice_bang -
slice_bang
rb_ary_slice_bang -
assoc
rb_ary_assoc -
rassoc
rb_ary_rassoc -
flatten
-
flatten_bang
-
flatten_bang
-
flatten_bang19
Deprecated. -
flatten
-
flatten
-
flatten19
Deprecated. -
flatten19
Deprecated. -
count
-
count
-
nitems
rb_ary_nitems -
op_plus
rb_ary_plus -
op_times
rb_ary_times -
op_times19
Deprecated. -
makeHash
ary_make_hash -
makeHash
-
makeHash
-
makeHash
-
setValuesFrom
-
clearValues
private void clearValues(int from, int to) -
uniq_bang
rb_ary_uniq_bang -
uniq_bang
-
uniq_bang19
Deprecated. -
uniq
rb_ary_uniq -
uniq
-
uniq19
Deprecated. -
op_diff
rb_ary_diff -
difference
rb_ary_difference_multi -
op_and
rb_ary_and -
op_or
rb_ary_or -
union
rb_ary_union_multi -
unionInternal
rb_ary_union -
sort
rb_ary_sort -
sort19
Deprecated. -
sort_bang
rb_ary_sort_bang -
sort_bang19
Deprecated. -
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 -
cycleCommon
-
cycleSize
A cycle size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[]) -
product
rb_ary_product -
product
-
product19
Deprecated. -
combination
rb_ary_combination -
combinate
private static void combinate(ThreadContext context, int len, int n, int[] stack, RubyArray values, Block block) -
rcombinate
private static void rcombinate(ThreadContext context, int n, int r, int[] p, RubyArray values, Block block) -
combinationSize
private static IRubyObject combinationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A combination size method suitable for method reference implementation of SizeFnsize(ThreadContext, RubyArray, IRubyObject[]). -
binomialCoefficient
-
repeatedCombination
-
repeatedCombinationSize
private static IRubyObject repeatedCombinationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A repeated combination size method suitable for method reference implementation of SizeFnsize(ThreadContext, RubyArray, IRubyObject[]). -
permute
private static void permute(ThreadContext context, int n, int r, int[] p, boolean[] used, RubyArray values, Block block) -
yieldValues
private static void yieldValues(ThreadContext context, int r, int[] p, int pStart, RubyArray values, Block block) -
rpermute
private static void rpermute(ThreadContext context, int n, int r, int[] p, RubyArray values, Block block) -
permutation
rb_ary_permutation -
permutation
-
repeated_permutation
-
repeatedPermutationSize
private static IRubyObject repeatedPermutationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A repeated permutation size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[]) -
permutationCommon
-
permutationSize
private static IRubyObject permutationSize(ThreadContext context, RubyArray self, IRubyObject[] args) A permutation size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[]) -
descendingFactorial
-
choice
Deprecated. -
shuffle_bang
-
shuffle_bang
-
shuffleBang
-
shuffle
-
shuffle
-
sample
-
sample
-
sample
-
sampleCommon
Common sample logic when no sample size was specified. -
sampleCommon
Common sample logic when a sample size was specified. -
aryReverse
-
internalRotateBang
-
rotateCount
private static int rotateCount(int cnt, int len) -
internalRotate
-
rotate_bang
-
rotate_bang
-
rotate
-
rotate
-
all_p
-
all_p
-
all_pCommon
-
all_pBlockless
-
any_p
-
any_p
-
any_pCommon
-
any_pBlockless
-
none_p
-
none_p
-
none_pCommon
-
none_pBlockless
-
one_p
-
one_p
-
one_pCommon
-
one_pBlockless
-
sum
-
sum
-
sumCommon
-
find
-
find_index
-
find_index
-
detectCommon
-
marshalTo
- Throws:
IOException
-
unmarshalFrom
- Throws:
IOException
-
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:
runtime- the runtimesize- the size- Returns:
- a RubyArray shaped for the given size
-
newBlankArrayInternal
-
newBlankArrayInternal
-
try_convert
-
pack
-
pack
-
dig
-
dig
-
dig
-
dig
-
maxWithBlock
-
max
-
max
-
minWithBlock
-
min
-
getArg0Generation
-
min
-
optimizedCmp
private static final int optimizedCmp(ThreadContext context, IRubyObject a, IRubyObject b, int token, CachingCallSite op_cmp, CallSite op_gt, CallSite op_lt) -
getJavaClass
Description copied from class:RubyBasicObjectWill return the Java interface that most closely can represent this object, when working through Java integration translations.- Specified by:
getJavaClassin interfaceIRubyObject- Overrides:
getJavaClassin classRubyBasicObject- Returns:
- the true Java class of this (Ruby) object
-
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
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:
sizein interfaceCollection<T extends IRubyObject>- Specified by:
sizein interfaceList<T extends IRubyObject>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<T extends IRubyObject>- Specified by:
isEmptyin interfaceList<T extends IRubyObject>
-
contains
- Specified by:
containsin interfaceCollection<T extends IRubyObject>- Specified by:
containsin interfaceList<T extends IRubyObject>
-
toArray
- Specified by:
toArrayin interfaceCollection<T extends IRubyObject>- Specified by:
toArrayin interfaceList<T extends IRubyObject>
-
toArray
- Specified by:
toArrayin interfaceCollection<T extends IRubyObject>- Specified by:
toArrayin interfaceList<T extends IRubyObject>
-
toJava
Description copied from interface:IRubyObjectConvert the object to the specified Java class, if possible.- Specified by:
toJavain interfaceIRubyObject- Overrides:
toJavain classRubyBasicObject- Parameters:
target- The target type to which the object should be converted.- See Also:
-
add
- Specified by:
addin interfaceCollection<T extends IRubyObject>- Specified by:
addin interfaceList<T extends IRubyObject>
-
remove
- Specified by:
removein interfaceCollection<T extends IRubyObject>- Specified by:
removein interfaceList<T extends IRubyObject>
-
containsAll
- Specified by:
containsAllin interfaceCollection<T extends IRubyObject>- Specified by:
containsAllin interfaceList<T extends IRubyObject>
-
addAll
- Specified by:
addAllin interfaceCollection<T extends IRubyObject>- Specified by:
addAllin interfaceList<T extends IRubyObject>
-
addAll
- Specified by:
addAllin interfaceList<T extends IRubyObject>
-
removeAll
- Specified by:
removeAllin interfaceCollection<T extends IRubyObject>- Specified by:
removeAllin interfaceList<T extends IRubyObject>
-
retainAll
- Specified by:
retainAllin interfaceCollection<T extends IRubyObject>- Specified by:
retainAllin interfaceList<T extends IRubyObject>
-
get
- Specified by:
getin interfaceList<T extends IRubyObject>
-
set
- Specified by:
setin interfaceList<T extends IRubyObject>
-
add
- Specified by:
addin interfaceList<T extends IRubyObject>
-
remove
- Specified by:
removein interfaceList<T extends IRubyObject>
-
indexOf
- Specified by:
indexOfin interfaceList<T extends IRubyObject>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<T extends IRubyObject>
-
iterator
- Specified by:
iteratorin interfaceCollection<T extends IRubyObject>- Specified by:
iteratorin interfaceIterable<T extends IRubyObject>- Specified by:
iteratorin interfaceList<T extends IRubyObject>
-
listIterator
- Specified by:
listIteratorin interfaceList<T extends IRubyObject>
-
listIterator
- Specified by:
listIteratorin interfaceList<T extends IRubyObject>
-
subList
- Specified by:
subListin interfaceList<T extends IRubyObject>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<T extends IRubyObject>- Specified by:
clearin interfaceList<T extends IRubyObject>
-
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Specified by:
equalsin interfaceCollection<T extends IRubyObject>- Specified by:
equalsin interfaceList<T extends IRubyObject>- Overrides:
equalsin classRubyObject- See Also:
-
safeArrayRef
-
safeArraySet
-
safeArraySet
protected static IRubyObject safeArraySet(Ruby runtime, IRubyObject[] values, int i, IRubyObject value) -
safeArrayRefSet
private static IRubyObject safeArrayRefSet(Ruby runtime, IRubyObject[] values, int i, IRubyObject value) -
safeArrayRefCondSet
private static IRubyObject safeArrayRefCondSet(Ruby runtime, IRubyObject[] values, int i, boolean doSet, IRubyObject value) -
safeArrayCopy
private void safeArrayCopy(IRubyObject[] source, int sourceStart, IRubyObject[] target, int targetStart, int length) -
safeArrayCopy
private static void safeArrayCopy(Ruby runtime, IRubyObject[] source, int sourceStart, IRubyObject[] target, int targetStart, int length) -
sites
-
compatc19
Deprecated. -
aryDup19
Deprecated. -
ensureCapacity
Deprecated.Increases the capacity of this Array, if necessary.- Parameters:
minCapacity- the desired minimum capacity of the internal array
-
flatten_bang19
Deprecated. -
map19
Deprecated. -
collect19
Deprecated. -
to_a
Deprecated.- Overrides:
to_ain classRubyBasicObject
-
shuffle
Deprecated. -
shuffle_bang
Deprecated. -
sample
Deprecated.
-