This is the base class for all specialized RubyArray.
Specialized RubyArray use fields rather than an IRubyObject[] to hold their values. When they need to grow or shrink, they unpack those values to a proper IRubyObject[] and fall back on RubyArray logic.
Subclasses should override all methods that would access the array directly to use the fields, with guards for the packed flag and access outside packed range. This includes the following methods (at the time of this writing...this list will evolve):
RubyArrayeltInternal(int)
RubyArrayeltInternalSet(int index, IRubyObject value)
RubyArraySpecializedfinishUnpack(IRubyObject nil)
RubyArrayaryDup()
RubyArrayrb_clear(org.jruby.runtime.ThreadContext)
RubyArraycollect(org.jruby.runtime.ThreadContext, org.jruby.runtime.Block)
RubyArraycopyInto(org.jruby.runtime.ThreadContext, IRubyObject[], int)
RubyArraycopyInto(org.jruby.runtime.ThreadContext, IRubyObject[], int, int)
RubyArraydupImpl(Ruby, RubyClass)
RubyArrayincludes(org.jruby.runtime.ThreadContext, IRubyObject)
RubyArrayindexOf(Object)
RubyArrayinspectAry(org.jruby.runtime.ThreadContext)
RubyArrayinternalRotate(org.jruby.runtime.ThreadContext, int)
RubyArrayinternalRotateBang(org.jruby.runtime.ThreadContext, int)
RubyArrayop_plus(org.jruby.runtime.ThreadContext, IRubyObject)
RubyArrayreverse_bang(org.jruby.runtime.ThreadContext)
RubyArraysafeReverse()
RubyArraysortInternal(org.jruby.runtime.ThreadContext, org.jruby.runtime.Block)
RubyArraysortInternal(org.jruby.runtime.ThreadContext, boolean)
RubyArraystoreInternal(org.jruby.runtime.ThreadContext, int, IRubyObject)
RubyArraysubseq(RubyClass, long, long, boolean)
RubyArraytoJavaArray(ThreadContext)
RubyArrayuniq(org.jruby.runtime.ThreadContext)
| Modifier and Type | Field and Description |
|---|---|
| public static final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract void | |
| protected boolean | |
| protected final void | unpack(ThreadContext context)
Overrides org. Overridden by specialized arrays to fall back to IRubyObject[]. |
| MAX_PACKED_SIZE | back to summary |
|---|---|
| public static final int MAX_PACKED_SIZE | |
| RubyArraySpecialized | back to summary |
|---|---|
| public RubyArraySpecialized(Ruby runtime, boolean light) | |
| RubyArraySpecialized | back to summary |
|---|---|
| public RubyArraySpecialized(RubyClass otherClass, boolean light) | |
| RubyArraySpecialized | back to summary |
|---|---|
| public RubyArraySpecialized(RubyClass otherClass) | |
| finishUnpack | back to summary |
|---|---|
| protected abstract void finishUnpack(IRubyObject nil) | |
| packed | back to summary |
|---|---|
| protected boolean packed() | |
| unpack | back to summary |
|---|---|
| protected final void unpack(ThreadContext context) Overrides org. Doc from org. Overridden by specialized arrays to fall back to IRubyObject[]. | |