Package org.jruby.java.proxies
Class ArrayJavaProxy
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.java.proxies.JavaProxy
org.jruby.java.proxies.ArrayJavaProxy
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.jruby.java.proxies.JavaProxy
JavaProxy.ClassMethodsNested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JavaUtil.JavaConverterprivate static final byte[]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
ConstructorsConstructorDescriptionArrayJavaProxy(Ruby runtime, RubyClass klazz, Object array) ArrayJavaProxy(Ruby runtime, RubyClass klazz, Object array, JavaUtil.JavaConverter converter) -
Method Summary
Modifier and TypeMethodDescriptionprivate IRubyObjectarrayRange(ThreadContext context, RubyRange range) private IRubyObjectarrayRange(ThreadContext context, IRubyObject rFirst, IRubyObject rLength) private static booleanarraysEquals(Object thisArray, Object thatArray) protected JavaArrayasJavaObject(Object array) private final IRubyObjectat(ThreadContext context, int i) at(ThreadContext context, IRubyObject index) protected Objectcomponent_type(ThreadContext context) private static intconvertArrayIndex(IRubyObject index) count(ThreadContext context, Block block) count(ThreadContext context, IRubyObject obj, Block unused) static RubyClasscreateArrayJavaProxy(ThreadContext context) final IRubyObjectdig(ThreadContext context, IRubyObject[] args) (package private) final IRubyObjectdig(ThreadContext context, IRubyObject[] args, int idx) dup()RubyMethod dup.each(ThreadContext context, Block block) each_with_index(ThreadContext context, Block block) empty_p(ThreadContext context) eql_p(ThreadContext context, IRubyObject obj) booleanThis override does not do a "checked" dispatch.private booleanequalsRubyArray(RubyArray rubyArray) first(ThreadContext context) first(ThreadContext context, IRubyObject count) get(int index) final JavaArraygetRange(ThreadContext context, IRubyObject arg0) getRange(ThreadContext context, IRubyObject[] args) getRange(ThreadContext context, IRubyObject first, IRubyObject length) hash()rb_obj_id Will return the hash code of this object.inthashCode()This override does not do "checked" dispatch since Object usually has #hash defined.include_p(ThreadContext context, IRubyObject obj) private booleanincludes(ThreadContext context, boolean[] array, IRubyObject obj) private booleanincludes(ThreadContext context, byte[] array, IRubyObject obj) private booleanincludes(ThreadContext context, char[] array, IRubyObject obj) private booleanincludes(ThreadContext context, double[] array, IRubyObject obj) private booleanincludes(ThreadContext context, float[] array, IRubyObject obj) private booleanincludes(ThreadContext context, int[] array, IRubyObject obj) private booleanincludes(ThreadContext context, long[] array, IRubyObject obj) private booleanincludes(ThreadContext context, short[] array, IRubyObject obj) private booleanincludes(ThreadContext context, Object[] array, IRubyObject obj) private static voidinitCopy(IRubyObject clone, IRubyObject original, String method) inspect(ThreadContext context) private static RubyStringinspectCharArrayPart(Ruby runtime, StringBuilder buffer, char[] ary, int len) private RubyStringinspectPrimitiveArray(Ruby runtime, Class<?> componentClass) last(ThreadContext context) last(ThreadContext context, IRubyObject count) final intlength()length(ThreadContext context) static ArrayJavaProxyfinal IRubyObjectop_aref(ThreadContext context, IRubyObject arg) final IRubyObjectop_aref(ThreadContext context, IRubyObject[] args) final IRubyObjectop_aset(ThreadContext context, IRubyObject index, IRubyObject value) op_equal(ThreadContext context, IRubyObject other) rb_obj_equal Will by default use identity equality to compare objects.op_plus(ThreadContext context, IRubyObject other) rbClone()RubyMethod clone.voidsetValue(Ruby runtime, int index, IRubyObject value) private IRubyObjectsubarrayProxy(ThreadContext context, Object ary, int aryLength, int index, int size) to_a(ThreadContext context) rb_any_to_a call-seq: obj.to_a -> anArray Returns an array representation of obj.toString()The default toString method is just a wrapper that calls the Ruby "to_s" method.Methods inherited from class org.jruby.java.proxies.JavaProxy
createJavaProxy, dataGetStruct, dataWrapStruct, equal_p, field_accessor, field_reader, field_writer, getJavaClass, getJavaClass, getObject, getSingletonClass, getVariable, inherited, initialize_copy, inspectHashCode, installField, java_class, java_method, java_method, java_send, java_send, java_send, java_send, marshal_dump, marshal_load, new_array, op_aref, persistent, persistent, setJavaClass, setJavaClass, setJavaClass, setObject, setVariable, singleton_class, toJava, unwrapMethods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, dig, dig1, dig2, eqlInternal, equalInternal, getNativeClassIndex, inspect, op_eqq, puts, specificEval, toRubyStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStructChecked, decode, display, ensureInstanceVariablesSettable, eql, eql_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, frozen_p, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClassClone, getSingletonClassCloneAndAttach, getType, getVariableCount, getVariableList, getVariableNameList, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize19, inspect, 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, nil_p, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, 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, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, 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, 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_p, testFrozen, testFrozen, to_a, to_s, trust, type, type_deprecated, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnder
-
Field Details
-
converter
-
END_BRACKET_COLON_SPACE
private static final byte[] END_BRACKET_COLON_SPACE
-
-
Constructor Details
-
ArrayJavaProxy
-
ArrayJavaProxy
public ArrayJavaProxy(Ruby runtime, RubyClass klazz, Object array, JavaUtil.JavaConverter converter)
-
-
Method Details
-
createArrayJavaProxy
-
newArray
-
asJavaObject
- Overrides:
asJavaObjectin classJavaProxy
-
getJavaArray
-
get
-
set
-
setValue
-
length
public final int length() -
length
-
empty_p
-
op_aref
-
op_aref
-
op_aset
-
include_p
-
includes
-
includes
-
includes
-
includes
-
includes
-
includes
-
includes
-
includes
-
includes
-
first
-
first
-
last
-
last
-
count
-
count
-
dig
-
dig
-
convertArrayIndex
-
at
-
at
-
op_plus
-
each
-
each_with_index
-
to_a
Description copied from class:RubyBasicObjectrb_any_to_a call-seq: obj.to_a -> anArray Returns an array representation of obj. For objects of classObjectand others that don't explicitly override the method, the return value is an array containingself. However, this latter behavior will soon be obsolete. self.to_a #=> -:1: warning: default `to_a' will be obsolete "hello".to_a #=> ["hello"] Time.new.to_a #=> [39, 54, 8, 9, 4, 2003, 3, 99, true, "CDT"] The default to_a method is deprecated.- Overrides:
to_ain classRubyBasicObject
-
component_type
-
inspect
-
inspectPrimitiveArray
-
inspectCharArrayPart
private static RubyString inspectCharArrayPart(Ruby runtime, StringBuilder buffer, char[] ary, int len) -
toString
Description copied from class:RubyObjectThe default toString method is just a wrapper that calls the Ruby "to_s" method.- Overrides:
toStringin classRubyObject
-
op_equal
Description copied from class:RubyBasicObjectrb_obj_equal Will by default use identity equality to compare objects. This follows the Ruby semantics. The name of this method doesn't follow the convention because hierarchy problems- Specified by:
op_equalin interfaceIRubyObject- Overrides:
op_equalin classRubyBasicObject
-
equalsRubyArray
-
eql_p
-
equals
Description copied from class:RubyObjectThis override does not do a "checked" dispatch.- Overrides:
equalsin classRubyObject- See Also:
-
arraysEquals
-
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
-
hashCode
public int hashCode()Description copied from class:RubyObjectThis override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCodein classRubyObject- See Also:
-
dup
Description copied from interface:IRubyObjectRubyMethod dup.- Specified by:
dupin interfaceIRubyObject- Overrides:
dupin classRubyBasicObject- Returns:
- a dup-ed object
-
initCopy
-
rbClone
Description copied from interface:IRubyObjectRubyMethod clone.- Specified by:
rbClonein interfaceIRubyObject- Overrides:
rbClonein classRubyBasicObject- Returns:
- a cloned object
-
cloneObject
- Overrides:
cloneObjectin classJavaProxy
-
getRange
-
getRange
-
arrayRange
-
getRange
-
arrayRange
-
subarrayProxy
private IRubyObject subarrayProxy(ThreadContext context, Object ary, int aryLength, int index, int size)
-