Package org.jruby.specialized
Class RubyArraySpecialized
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyArray
org.jruby.specialized.RubyArraySpecialized
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable
,Iterable
,Collection
,List
,RandomAccess
,SequencedCollection
,InstanceVariables
,InternalVariables
,IRubyObject
,CoreObjectType
- Direct Known Subclasses:
RubyArrayOneObject
,RubyArrayTwoObject
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):
RubyArrayRubyArray.eltInternal(int)
RubyArrayRubyArray.eltInternalSet(int index, IRubyObject value)
RubyArraySpecializedfinishUnpack(IRubyObject nil)
RubyArrayRubyArray.aryDup()
RubyArrayRubyArray.rb_clear(org.jruby.runtime.ThreadContext)
RubyArrayRubyArray.collect(org.jruby.runtime.ThreadContext, org.jruby.runtime.Block)
RubyArrayRubyArray.copyInto(org.jruby.runtime.ThreadContext,IRubyObject[], int)
RubyArrayRubyArray.copyInto(org.jruby.runtime.ThreadContext,IRubyObject[], int, int)
RubyArrayRubyArray.dupImpl(Ruby, RubyClass)
RubyArrayRubyArray.includes(org.jruby.runtime.ThreadContext, IRubyObject)
RubyArrayRubyArray.indexOf(Object)
RubyArrayRubyArray.inspectAry(org.jruby.runtime.ThreadContext)
RubyArrayRubyArray.internalRotate(org.jruby.runtime.ThreadContext, int)
RubyArrayRubyArray.internalRotateBang(org.jruby.runtime.ThreadContext, int)
RubyArrayRubyArray.op_plus(org.jruby.runtime.ThreadContext, IRubyObject)
RubyArrayRubyArray.reverse_bang(org.jruby.runtime.ThreadContext)
RubyArrayRubyArray.safeReverse()
RubyArrayRubyArray.sortInternal(org.jruby.runtime.ThreadContext, org.jruby.runtime.Block)
RubyArrayRubyArray.sortInternal(org.jruby.runtime.ThreadContext, boolean)
RubyArrayRubyArray.storeInternal(org.jruby.runtime.ThreadContext, int, IRubyObject)
RubyArrayRubyArray.subseq(RubyClass, long, long, boolean)
RubyArrayRubyArray.toJavaArray(ThreadContext)
RubyArrayRubyArray.uniq(org.jruby.runtime.ThreadContext)
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jruby.RubyArray
RubyArray.ArgumentVisitor, RubyArray.DefaultComparator, RubyArray.RubyArrayConversionIterator
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
-
Field Summary
FieldsFields inherited from class org.jruby.RubyArray
ARRAY_DEFAULT_SIZE, begin, DEFAULT_INSPECT_STR_SIZE, realLength, values
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
ConstructorsConstructorDescriptionRubyArraySpecialized
(RubyClass otherClass) RubyArraySpecialized
(RubyClass otherClass, boolean light) RubyArraySpecialized
(Ruby runtime, boolean light) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
finishUnpack
(IRubyObject nil) protected boolean
packed()
protected final void
unpack
(ThreadContext context) Overridden by specialized arrays to fall back to IRubyObject[].Methods inherited from class org.jruby.RubyArray
add, add, add, addAll, addAll, all_p, all_p, all_pCommon, any_p, any_p, any_pCommon, append, append, aref, aref, aref, aref, aref, aryAppend, aryAppend, aryDup, aryToAry, aryToAry, aset, aset, aset, aset, aset, assoc, at, at, bsearch, bsearch_index, checkArrayType, checkLength, checkLength, clear, collect, collect_bang, collectArray, collectBang, collectEnum, combination, compact, compact, compact_bang, compact_bang, compare, compareFixnums, compareOthers, concat, concat, concat, concurrentModification, contains, containsAll, convertToArray, copyInto, copyInto, copyInto, copyInto, count, count, create, create, createArrayClass, cycle, cycle, deconstruct, delete, delete_at, delete_at, delete_at, delete_at, delete_if, deleteIf, detectCommon, difference, dig, dig, dig, dig, drop, drop_while, dup, dupImpl, each, each_index, each_slice, eachIndex, eachSlice, eltInternal, eltInternalSet, eltOk, eltSetOk, eltSetOk, empty_p, empty_p, ensureCapacity, entry, entry, eql, equals, fetch, fetch, fetch, fetch_values, fill, fill, fill, fill, fillCommon, fillCommon, find, find_index, find_index, first, first, first, first, first, flatten, flatten, flatten, flatten_bang, flatten_bang, frozen_p, get, getJavaClass, getLength, getList, getNativeClassIndex, hash, include_p, includes, includesByEql, index, index, index, indexes, indexes, indexOf, initialize, initialize, initialize, initialize, initialize_copy, initializeCommon, insert, insert, insert, insert, insert, insert, insert, inspect, inspectAry, internalRotate, internalRotateBang, intersect_p, intersection, isEmpty, isSharedJavaArray, iterator, join, join, join19, join19, joinStrings, keep_if, last, last, last, last, last, lastIndexOf, length, length, listIterator, listIterator, makeShared, map, map_bang, marshalTo, marshalTo, marshalTo, max, max, min, min, minmax, modify, modify, modifyCheck, modifyCheck, newArray, newArray, newArray, newArray, newArray, newArray, newArray, newArray, newArray, newArray, newArray, newArray, newArrayLight, newArrayLight, newArrayLight, newArrayLight, newArrayLight, newArrayLight, newArrayLight, newArrayLight, newArrayMayCopy, newArrayMayCopy, newArrayMayCopy, newArrayNoCopy, newArrayNoCopy, newArrayNoCopy, newArrayNoCopyLight, newBlankArray, newBlankArray, newEmptyArray, newEmptyArray, newSharedArray, nitems, nitems, none_p, none_p, none_pCommon, one_p, one_p, one_pCommon, op_and, op_and, op_cmp, op_diff, op_diff, op_equal, op_or, op_or, op_plus, op_plus, op_times, pack, pack, permutation, permutation, pop, pop, product, product, push, push, push, push, push_m, rassoc, rb_clear, rb_clear, rbCollect, reject, reject_bang, rejectBang, rejectCommon, remove, remove, removeAll, repeated_permutation, repeatedCombination, replace, replace, retainAll, reverse, reverse, reverse_bang, reverse_bang, reverse_each, reverseEach, rindex, rindex, rindex, rotate, rotate, rotate_bang, rotate_bang, rubyStream, safeArraySet, safeReverse, sample, sample, sample, sample, select, select_bang, selectCommon, set, shift, shift, shuffle, shuffle, shuffle, shuffle_bang, shuffle_bang, shuffle_bang, size, size, slice_bang, slice_bang, slice_bang, slice_bang, slice_bang, sort, sort_bang, sort_by_bang, sortInternal, sortInternal, store, store, storeInternal, subList, subseq, subseq, subseq_step, subseqLight, sum, sum, sumCommon, take, take_while, to_a, to_a, to_ary, to_ary, to_h, to_h, to_s, toArray, toArray, toJava, toJavaArray, toJavaArray, toJavaArrayMaybeUnsafe, toJavaArrayUnsafe, transpose, transpose, try_convert, union, uniq, uniq, uniq_bang, uniq_bang, unmarshalFrom, unmarshalFrom, unshift, unshift, unshift, unshift, unshift, unshift, values_at, values_at, zip
Methods 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
-
MAX_PACKED_SIZE
public static final int MAX_PACKED_SIZE- See Also:
-
-
Constructor Details
-
RubyArraySpecialized
-
RubyArraySpecialized
-
RubyArraySpecialized
-
-
Method Details