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 classes/interfaces inherited from class org.jruby.java.proxies.JavaProxy
JavaProxy.ClassMethods
Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.Data
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer
-
Field Summary
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
ConstructorsConstructorDescriptionArrayJavaProxy
(Ruby runtime, RubyClass klazz, Object array) ArrayJavaProxy
(Ruby runtime, RubyClass klazz, Object array, JavaUtil.JavaConverter converter) -
Method Summary
Modifier and TypeMethodDescriptionprotected JavaArray
asJavaObject
(Object array) Deprecated.at
(ThreadContext context, IRubyObject index) protected Object
component_type
(ThreadContext context) count
(ThreadContext context, Block block) count
(ThreadContext context, IRubyObject obj, Block unused) static RubyClass
createArrayJavaProxy
(ThreadContext context, RubyClass JavaProxy, RubyModule Enumerable) final IRubyObject
dig
(ThreadContext context, IRubyObject[] args) 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) boolean
This override does not do a "checked" dispatch.first
(ThreadContext context) first
(ThreadContext context, IRubyObject count) get
(int index) Class
<?> final JavaArray
Deprecated.getRange
(ThreadContext context, IRubyObject arg0) getRange
(ThreadContext context, IRubyObject[] args) getRange
(ThreadContext context, IRubyObject first, IRubyObject length) hash
(ThreadContext context) Will return the hash code of this object.int
hashCode()
This override does not do "checked" dispatch since Object usually has #hash defined.include_p
(ThreadContext context, IRubyObject obj) inspect
(ThreadContext context) Returns a string containing a human-readable representation of obj.last
(ThreadContext context) last
(ThreadContext context, IRubyObject count) final int
length()
length
(ThreadContext context) static ArrayJavaProxy
Deprecated.static ArrayJavaProxy
newArray
(ThreadContext context, Class<?> elementType, int... dimensions) final IRubyObject
op_aref
(ThreadContext context, IRubyObject arg) final IRubyObject
op_aref
(ThreadContext context, IRubyObject[] args) final IRubyObject
op_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.void
setValue
(Ruby runtime, int index, IRubyObject value) protected static IRubyObject
size
(ThreadContext context, ArrayJavaProxy self, IRubyObject[] args) A size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])
to_a
(ThreadContext context) 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
checkVariablesOnProxy, createJavaProxy, dataGetStruct, dataWrapStruct, equal_p, field_accessor, field_reader, field_writer, getJavaClass, getJavaClass, getObject, getVariable, inherited, initialize_copy, inspectHashCode, installField, java_class, java_method, java_method, java_send, java_send, java_send, java_send, marshal_dump, marshal_dump, marshal_load, new_array, op_aref, persistent, persistent, setJavaClass, setJavaClass, setJavaClass, setObject, setVariable, singleton_class, singleton_class, singletonClass, toJava, unwrap, wrap
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, getNativeClassIndex, inspect, op_eqq, puts, specificEval, toRubyString
Methods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStructChecked, decode, display, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize, initialize_copy, inspect, 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_cmp, op_match, op_not, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, 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, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_s, 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 org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariables
-
Constructor Details
-
ArrayJavaProxy
-
ArrayJavaProxy
public ArrayJavaProxy(Ruby runtime, RubyClass klazz, Object array, JavaUtil.JavaConverter converter)
-
-
Method Details
-
createArrayJavaProxy
public static RubyClass createArrayJavaProxy(ThreadContext context, RubyClass JavaProxy, RubyModule Enumerable) -
newArray
@Deprecated(since="10.0") public static ArrayJavaProxy newArray(Ruby runtime, Class<?> elementType, int... dimensions) Deprecated. -
newArray
public static ArrayJavaProxy newArray(ThreadContext context, Class<?> elementType, int... dimensions) -
asJavaObject
Deprecated.- Overrides:
asJavaObject
in classJavaProxy
-
getJavaArray
Deprecated. -
get
-
set
-
setValue
-
length
public final int length() -
length
-
empty_p
-
op_aref
-
op_aref
-
op_aset
-
include_p
-
first
-
first
-
last
-
last
-
count
-
count
-
dig
-
at
-
op_plus
-
each
-
each_with_index
-
to_a
- Overrides:
to_a
in classRubyBasicObject
-
getComponentType
-
component_type
-
inspect
Description copied from class:RubyBasicObject
Returns a string containing a human-readable representation of obj. If not overridden, uses theto_s
method 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:
inspect
in interfaceIRubyObject
- Overrides:
inspect
in classRubyBasicObject
-
toString
Description copied from class:RubyObject
The default toString method is just a wrapper that calls the Ruby "to_s" method.- Overrides:
toString
in classRubyObject
- Returns:
- string representation
-
op_equal
Description copied from class:RubyBasicObject
rb_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_equal
in interfaceIRubyObject
- Overrides:
op_equal
in classRubyBasicObject
-
eql_p
- Overrides:
eql_p
in classRubyBasicObject
-
equals
Description copied from class:RubyObject
This override does not do a "checked" dispatch.- Overrides:
equals
in classRubyObject
- Parameters:
obj
- object to compare- Returns:
- true if equals
- See Also:
-
hash
Description copied from class:RubyBasicObject
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:
hash
in classRubyBasicObject
- Parameters:
context
- the current thread context- Returns:
- the hash value
-
hashCode
public int hashCode()Description copied from class:RubyObject
This override does not do "checked" dispatch since Object usually has #hash defined.- Overrides:
hashCode
in classRubyObject
- Returns:
- the hash code
- See Also:
-
dup
Description copied from interface:IRubyObject
RubyMethod dup.- Specified by:
dup
in interfaceIRubyObject
- Overrides:
dup
in classRubyBasicObject
- Returns:
- a dup-ed object
-
rbClone
Description copied from interface:IRubyObject
RubyMethod clone.- Specified by:
rbClone
in interfaceIRubyObject
- Overrides:
rbClone
in classRubyBasicObject
- Returns:
- a cloned object
-
cloneObject
- Overrides:
cloneObject
in classJavaProxy
-
getRange
-
getRange
-
getRange
-
size
A size method suitable for lambda method reference implementation ofRubyEnumerator.SizeFn.size(ThreadContext, IRubyObject, IRubyObject[])
- See Also:
-