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):
RubyArray#eltInternal(int)
RubyArray#eltInternalSet(int index, IRubyObject value)
RubyArraySpecialized#finishUnpack(IRubyObject nil)
RubyArray#aryDup()
RubyArray#rb_clear(org.jruby.runtime.ThreadContext)
RubyArray#collect(org.jruby.runtime.ThreadContext, org.jruby.runtime.Block)
RubyArray#copyInto(org.jruby.runtime.ThreadContext,IRubyObject[], int)
RubyArray#copyInto(org.jruby.runtime.ThreadContext,IRubyObject[], int, int)
RubyArray#dupImpl(Ruby, RubyClass)
RubyArray#includes(org.jruby.runtime.ThreadContext, IRubyObject)
RubyArray#indexOf(Object)
RubyArray#inspectAry(org.jruby.runtime.ThreadContext)
RubyArray#internalRotate(org.jruby.runtime.ThreadContext, int)
RubyArray#internalRotateBang(org.jruby.runtime.ThreadContext, int)
RubyArray#op_plus(org.jruby.runtime.ThreadContext, IRubyObject)
RubyArray#reverse_bang(org.jruby.runtime.ThreadContext)
RubyArray#safeReverse()
RubyArray#sortInternal(org.jruby.runtime.ThreadContext, org.jruby.runtime.Block)
RubyArray#sortInternal(org.jruby.runtime.ThreadContext, boolean)
RubyArray#storeInternal(org.jruby.runtime.ThreadContext, int, IRubyObject)
RubyArray#subseq(RubyClass, long, long, boolean)
RubyArray#toJavaArray(ThreadContext)
RubyArray#uniq(org.jruby.runtime.ThreadContext)
| constant | type | note |
|---|---|---|
| MAX_PACKED_SIZE | int |
<init>(org.jruby.RubyClass otherClass, boolean light)| field | type | note |
|---|---|---|
| NULL_ARRAY | IRubyObject[] |
#checkStringType() instead.
is this a string?
Returns: the string if so
RubyMethod dup.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
Returns: a dup-ed object
marshalLiveVariables(org.jruby.runtime.marshal.MarshalDumper stream, org.jruby.runtime.ThreadContext context, org.jruby.util.io.RubyOutputStream out)forEach(java.util.function.Consumer<? super T> arg0)| field | type | note |
|---|---|---|
| ALL_F | int | |
| BASICOBJECT_ALLOCATOR | ObjectAllocator | Default allocator instance for all Ruby objects. The only reason to not use this allocator is if you actually need to have all instances of something be a subclass of RubyObject. |
| COMPARE_BY_IDENTITY_F | int | |
| ERR_INSECURE_SET_INST_VAR | String | The error message used when some one tries to modify an instance variable in a high security setting. |
| FALSE_F | int | |
| FL_USHIFT | int | |
| FROZEN_F | int | |
| IS_OVERLAID_F | int | |
| NEVER | IRubyObject | A value that is used as a null sentinel in among other places the RubyArray implementation. It will cause large problems to call any methods on this object. |
| NIL_F | int | This flag is a bit funny. It's used to denote that this value
is nil. It's a bit counterintuitive for a Java programmer to
not use subclassing to handle this case, since we have a
RubyNil subclass anyway. Well, the reason for it being a flag
is that the #isNil() method is called extremely often. So often
that it gives a good speed boost to make it monomorphic and
final. It turns out using a flag for this actually gives us
better performance than having a polymorphic #isNil() method. |
| REFINED_MODULE_F | int | |
| STAMP_OFFSET | long | |
| TAINTED_F | int | |
| UNDEF | IRubyObject | A value that specifies an undefined value. This value is used as a sentinel for undefined constant values, and other places where neither null nor NEVER makes sense. |
| USER0_F | int | |
| USER1_F | int | |
| USER2_F | int | |
| USER3_F | int | |
| USER4_F | int | |
| USER5_F | int | |
| USER6_F | int | |
| USER7_F | int | |
| USER8_F | int | |
| USER9_F | int | |
| USERA_F | int | |
| VAR_TABLE_OFFSET | long | |
| varTable | Object[] | variable table, lazily allocated as needed (if needed) |
| varTableStamp | int | locking stamp for Unsafe ops updating the vartable |
rb_obj_id Return the internal id of an object.
addFinalizer(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject f)Adds the specified object as a finalizer for this object.
Internal method that helps to convert any object into the format of a class name and a hex string inside of #<>.
asJavaString()rb_to_id Will try to convert this object to a String using the Ruby "to_str" if the object isn't already a String. If this still doesn't work, will throw a Ruby TypeError.
Returns: a (Java) string
rb_obj_as_string
First converts this object into a String using the "to_s"
method and returns it. If
to_s doesn't return a Ruby String, Convert#anyToString is used
instead.
callMethod(org.jruby.runtime.ThreadContext context, String name)Will invoke a named method with no arguments and no block.
callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject arg)Will invoke a named method with one argument and no block with functional invocation.
callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args)Will invoke a named method with the supplied arguments and no block with functional invocation.
callMethod(String name, org.jruby.runtime.builtin.IRubyObject[] args)callMethod(String name, org.jruby.runtime.builtin.IRubyObject arg)callMethod(org.jruby.runtime.ThreadContext context, String name, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)Will invoke a named method with the supplied arguments and supplied block with functional invocation.
callMethod(org.jruby.runtime.ThreadContext context, int methodIndex, String name)callMethod(org.jruby.runtime.ThreadContext context, int methodIndex, String name, org.jruby.runtime.builtin.IRubyObject arg)callSuper(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)checkCallMethod(org.jruby.runtime.ThreadContext context, String name)Will invoke a named method with no arguments and no block if that method or a custom method missing exists. Otherwise returns null. 1.9: rb_check_funcall
checkCallMethod(org.jruby.runtime.ThreadContext context, org.jruby.runtime.JavaSites.CheckedSites sites)Will invoke a named method with no arguments and no block if that method or a custom method missing exists. Otherwise returns null. 1.9: rb_check_funcall
checkFrozen()The actual method that checks frozen with the default frozen message from MRI.
If possible, call this instead of #testFrozen.
rb_check_string_type Tries to return a coerced string representation of this object, using "to_str". If that returns something other than a String or nil, an empty String will be returned.
isClass() · also: is_classSpecifically polymorphic method that are meant to be overridden by classes to specify that they are classes in an easy way.
Compares this Ruby object with another.
| name | type | description |
|---|---|---|
| other | org.jruby.runtime.builtin.IRubyObject | another IRubyObject |
Returns: 0 if equal, < 0 if this is less than other, > 0 if this is greater than other
Tries to convert this object to a Ruby Float using the "to_f" method.
Returns: float representation of this
Tries to convert this object to a Ruby Hash using the "to_hash" method.
Returns: hash representation of this
Tries to convert this object to a Ruby Integer using the "to_int" method.
Returns: an integer representation of this
convertToInteger(String convertMethod)Tries to convert this object to a Ruby Integer using the supplied conversion method.
| name | type | description |
|---|---|---|
| convert_method | String | conversion method to use e.g. "to_i" |
Returns: an integer representation of this
convertToInteger(int methodIndex, String convertMethod)Tries to convert this object to a Ruby String using the "to_str" method.
Returns: a string representation of this
copyInstanceVariablesInto(org.jruby.runtime.builtin.InstanceVariables other)copySpecialInstanceVariables(org.jruby.runtime.builtin.IRubyObject clone)Lots of MRI objects keep their state in non-lookupable ivars (e:g. Range, Struct, etc). This method is responsible for dupping our java field equivalents
dataGetStruct()dataGetStructChecked()dataWrapStruct(Object obj)raw (id) strings are not properly encoded but in an iso_8859_1 form. This method will lookup properly encoded string from the symbol table.
| name | type | description |
|---|---|---|
| id | String | the id of the string |
Returns: the string of the symbol found from id
display(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)ensureInstanceVariablesSettable()Makes sure that instance variables can be set on this object, including information about whether this object is frozen. Will throw a suitable exception in that case.
method used for Hash key comparison (specialized for String, Symbol and Fixnum)
Returns: Will by default just call the Ruby method "eql?"
eql_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)equal_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)rb_obj_equal Will use Java identity equality.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| other | org.jruby.runtime.builtin.IRubyObject | to compare with |
Returns: are they equal?
evalUnder(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule under, org.jruby.RubyString src, String file, int line, org.jruby.EvalType evalType)extend(org.jruby.runtime.builtin.IRubyObject[] args)rb_obj_extend call-seq: obj.extend(module, ...) => obj Adds to _obj_ the instance methods from each module given as a parameter. module Mod def hello "Hello from Mod.\n" end end class Klass def hello "Hello from Klass.\n" end end k = Klass.new k.hello #=> "Hello from Klass.\n" k.extend(Mod) #=> #<Klass:0x401b3bc8> k.hello #=> "Hello from Mod.\n"
| name | type | description |
|---|---|---|
| args | org.jruby.runtime.builtin.IRubyObject[] | to use as modules to extend |
Returns: itself
isFalse() · also: is_falseIs this value a falsey value or not? Based on the #FALSE_F flag.
Returns: true is false
fastGetInstanceVariable(String internedName)fastGetInternalVariable(String internedName)fastHasInstanceVariable(String internedName)fastHasInternalVariable(String internedName)fastSetInstanceVariable(String internedName, org.jruby.runtime.builtin.IRubyObject value)fastSetInternalVariable(String internedName, Object value)getFFIHandle() · also: get_ffi_handlesetFFIHandle(Object value) · also: set_ffi_handleforEachInstanceVariable(java.util.function.BiConsumer<String,org.jruby.runtime.builtin.IRubyObject> accessor)forEachInstanceVariableName(java.util.function.Consumer<String> consumer)setFrozen(boolean frozen) · also: set_frozenSets whether this object is frozen or not. Shortcut for doing setFlag(FROZEN_F, frozen).
| name | type | description |
|---|---|---|
| frozen | boolean | should this object be frozen? |
isFrozen() · also: is_frozenIs this value frozen or not? Shortcut for doing getFlag(FROZEN_F).
Returns: true if this object is frozen, false otherwise
getFlag(int flag)Get the value of a custom flag on this object. The only guaranteed flags that can be sent in to this method is:
#FALSE_F#NIL_F#FROZEN_F| name | type | description |
|---|---|---|
| flag | int | the flag to get |
Returns: true if the flag is set, false otherwise
getInternalVariable(String name)getVariable(int index)hasInstanceVariable(String name)hasInternalVariable(String name)hasVariables() · also: has_variablesReturns true if object has any variables
RubyBasicObject#hash(ThreadContext) instead.
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.
Returns: hash value
isImmediate() · also: is_immediateIs object immediate (def: Fixnum, Symbol, true, false, nil?).
initialize(org.jruby.runtime.ThreadContext context)initialize_copy(org.jruby.runtime.builtin.IRubyObject original)org.jruby.RubyBasicObject#initialize_copy(ThreadContext, IRubyObject) instead.
| name | type | description |
|---|---|---|
| original | org.jruby.runtime.builtin.IRubyObject | object |
Returns: a copy
instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)instance_eval(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)instance_exec(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)rb_obj_instance_exec call-seq: obj.instance_exec(arg...) {|var...| block } => obj Executes the given block within the context of the receiver (_obj_). In order to set the context, the variable +self+ is set to _obj_ while the code is executing, giving the code access to _obj_'s instance variables. Arguments are passed as block parameters. class Klass def initialize @secret = 99 end end k = Klass.new k.instance_exec(5) {|x| @secret+x } #=> 104
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| args | org.jruby.runtime.builtin.IRubyObject[] | the args |
| block | org.jruby.runtime.Block | block |
Returns: the result
instance_of_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject type)rb_obj_is_instance_of
call-seq:
obj.instance_of?(class) => true or false
Returns true if obj is an instance of the given
class. See also Object#kind_of?.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| type | org.jruby.runtime.builtin.IRubyObject | the type |
Returns: true if this is instance of type
instance_variable_defined_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)rb_obj_ivar_defined
call-seq:
obj.instance_variable_defined?(symbol) => true or false
Returns true if the given instance variable is
defined in obj.
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
fred.instance_variable_defined?(:@a) #=> true
fred.instance_variable_defined?("@b") #=> true
fred.instance_variable_defined?("@c") #=> false
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
Returns: true if defined
instance_variable_get(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)rb_obj_ivar_get
call-seq:
obj.instance_variable_get(symbol) => obj
Returns the value of the given instance variable, or nil if the
instance variable is not set. The @ part of the
variable name should be included for regular instance
variables. Throws a NameError exception if the
supplied symbol is not valid as an instance variable name.
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
fred.instance_variable_get(:@a) #=> "cat"
fred.instance_variable_get("@b") #=> 99
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
Returns: value of ivar
getInstanceVariableList() · also: get_instance_variable_listGets a list of all variables in this object.
getInstanceVariableNameList() · also: get_instance_variable_name_listGets a name list of all variables in this object.
instance_variable_set(org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.builtin.IRubyObject value)rb_obj_ivar_set call-seq: obj.instance_variable_set(symbol, obj) => obj Sets the instance variable names by symbol to object, thereby frustrating the efforts of the class's author to attempt to provide proper encapsulation. The variable did not have to exist prior to this call. class Fred def initialize(p1, p2) @a, @b = p1, p2 end end fred = Fred.new('cat', 99) fred.instance_variable_set(:@a, 'dog') #=> "dog" fred.instance_variable_set(:@c, 'cat') #=> "cat" fred.inspect #=> "#<Fred:0x401b3da8 @a=\"dog\", @b=99, @c=\"cat\">"
| name | type | description |
|---|---|---|
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
| value | org.jruby.runtime.builtin.IRubyObject | to set |
Returns: value of old set ivar
getInstanceVariables() · also: get_instance_variablesDummy method to avoid a cast, and to avoid polluting the IRubyObject interface with all the instance variable management methods.
instance_variables(org.jruby.runtime.ThreadContext context)rb_obj_instance_variables call-seq: obj.instance_variables => array Returns an array of instance variable names for the receiver. Note that simply defining an accessor does not create the corresponding instance variable. class Fred attr_accessor :a1 def initialize @iv = 3 end end Fred.new.instance_variables #=> [:"@iv"]
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
Returns: list of ivars
getInternalVariables() · also: get_internal_variablesDummy method to avoid a cast, and to avoid polluting the IRubyObject interface with all the instance variable management methods.
isBuiltin(String methodName)A method to determine whether the method named by methodName is a builtin method, i.e. a method built-in to JRuby and loaded during its core boot process.
| name | type | description |
|---|---|---|
| method_name | String | to look for. |
Returns: true if so
kind_of_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject type)rb_obj_is_kind_of
call-seq:
obj.is_a?(class) => true or false
obj.kind_of?(class) => true or false
Returns true if class is the class of
obj, or if class is one of the superclasses of
obj or modules included in obj.
module M; end
class A
include M
end
class B < A; end
class C < B; end
b = B.new
b.instance_of? A #=> false
b.instance_of? B #=> true
b.instance_of? C #=> false
b.instance_of? M #=> false
b.kind_of? A #=> true
b.kind_of? B #=> true
b.kind_of? C #=> false
b.kind_of? M #=> true
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| type | org.jruby.runtime.builtin.IRubyObject | the type |
Returns: true if this is kind of type
makeMetaClass(org.jruby.runtime.ThreadContext context, org.jruby.RubyClass superClass)rb_make_metaclass Will create a new meta class, insert this in the chain of classes for this specific object, and return the generated meta class.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| super_class | org.jruby.RubyClass | the super class |
Returns: the new meta class
makeMetaClassBootstrap(org.jruby.Ruby runtime, org.jruby.RubyClass superClass, org.jruby.RubyClass Class)This will create a new metaclass. This is only used during bootstrapping before
the initial ThreadContext is defined. Normal needs of making a metaclass should use
RubyBasicObject#makeMetaClass(ThreadContext, RubyClass)
| name | type | description |
|---|---|---|
| runtime | org.jruby.Ruby | the runtime |
| super_class | org.jruby.RubyClass | of the metaclass |
| class | org.jruby.RubyClass | a reference to Ruby Class |
Returns: the new metaclass
getMarshalVariableList() · also: get_marshal_variable_listif exist return the meta-class else return the type of the object.
setMetaClass(org.jruby.RubyClass metaClass) · also: set_meta_classMakes it possible to change the metaclass of an object. In practice, this is a simple version of Smalltalks Become, except that it doesn't work when we're dealing with subclasses. In practice it's used to change the singleton/meta class used, without changing the "real" inheritance chain.
| name | type | description |
|---|---|---|
| meta_class | org.jruby.RubyClass | the meta class to set |
method(org.jruby.runtime.builtin.IRubyObject name, org.jruby.parser.StaticScope refinedScope)method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name, org.jruby.parser.StaticScope refinedScope)Like #method(IRubyObject) but using the given refinement scope to search for the method.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | the name of the method |
| refined_scope | org.jruby.parser.StaticScope | the static scope for the caller method |
Returns: method instance
methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_obj_methods call-seq: obj.methods => array Returns a list of the names of methods publicly accessible in obj. This will include all the methods accessible in obj's ancestors. class Klass def kMethod() end end k = Klass.new k.methods[0..9] #=> ["kMethod", "freeze", "nil?", "is_a?", "class", "instance_variable_set", "methods", "extend", "__send__", "instance_eval"] k.methods.length #=> 42
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| args | org.jruby.runtime.builtin.IRubyObject[] | include ancestors |
Returns: methods
methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, boolean useSymbols)isModule() · also: is_moduleSpecifically polymorphic method that are meant to be overridden by modules to specify that they are modules in an easy way.
getNativeHandle() · also: get_native_handlesetNativeHandle(Object value) · also: set_native_handlegetNativeTypeIndex() · also: get_native_type_indexisNil() · also: is_nilDoes this object represent nil? See the docs for the #NIL_F flag for more information.
rb_false
call_seq:
nil.nil? => true
<anything_else>.nil? => false
Only the object nil responds true to nil?.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
Returns: true if nil
op_match(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)rb_obj_pattern_match
call-seq:
obj =~ other => nil
Pattern Match---Overridden by descendents (notably
Regexp and String) to provide meaningful
pattern-match semantics.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| arg | org.jruby.runtime.builtin.IRubyObject | arg |
Returns: true if matches (always nil)
op_not_equal(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)The != method implemented for BasicObject.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | thread context |
| other | org.jruby.runtime.builtin.IRubyObject | other object |
Returns: false if this == other, true otherwise
op_not_match(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)Invert the match operator.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| arg | org.jruby.runtime.builtin.IRubyObject | arg |
Returns: true if they do not match
private_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)protected_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)public_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rbClone(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject maybeOpts)removeFinalizers()Remove all the finalizers for this object.
remove_instance_variable(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name, org.jruby.runtime.Block block)rb_obj_remove_instance_variable call-seq: obj.remove_instance_variable(symbol) => obj Removes the named instance variable from obj, returning that variable's value. class Dummy attr_reader :var def initialize @var = 99 end def remove remove_instance_variable(:@var) end end d = Dummy.new d.var #=> 99 d.remove #=> 99 d.var #=> nil
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| name | org.jruby.runtime.builtin.IRubyObject | of ivar |
| block | org.jruby.runtime.Block | the block (not used) |
Returns: value of removed ivar
removeInternalVariable(String name)respond_to_p(org.jruby.runtime.builtin.IRubyObject mname)respond_to_p(org.jruby.runtime.builtin.IRubyObject mname, org.jruby.runtime.builtin.IRubyObject includePrivate)respondsTo(String name)Does this object respond to the specified message? Uses a shortcut if it can be proved that respond_to? and respond_to_missing? haven't been overridden.
respondsToMissing(String name)Does this object respond to the specified message via "method_missing?"
respondsToMissing(String name, boolean incPrivate)Does this object respond to the specified message via "method_missing?"
Will return the runtime that this object is associated with.
Returns: current runtime
send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)send(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)setFlag(int flag, boolean set)Sets or unsets a flag on this object. The only flags that are guaranteed to be valid to use as the first argument is:
#FALSE_F#NIL_F#FROZEN_F| name | type | description |
|---|---|---|
| flag | int | the actual flag to set or unset. |
| set | boolean | if true, the flag will be set, if false, the flag will be unset. |
setInstanceVariable(String name, org.jruby.runtime.builtin.IRubyObject value)rb_iv_set / rb_ivar_set
setInternalVariable(String name, Object value)setVariable(int index, Object value)singletonClass(org.jruby.runtime.ThreadContext context)Will either return the existing singleton class for this object, or create a new one and return that. For a few types a singleton class is not possible so it will throw an error.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
Returns: the singleton of this type
singleton_method(org.jruby.runtime.builtin.IRubyObject name)singleton_method(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject name)singleton_methods(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)isSpecialConst() · also: is_special_constisSpecialObject() · also: is_special_objectspecificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
specificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| arg | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
specificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| arg0 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| arg1 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
specificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block, org.jruby.EvalType evalType)specific_eval Evaluates the block or string inside of the context of this object, using the supplied arguments. If a block is given, this will be yielded in the specific context of this object. If no block is given then a String-like object needs to be the first argument, and this string will be evaluated. Second and third arguments in the args-array is optional, but can contain the filename and line of the string under evaluation.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the thread context |
| mod | org.jruby.RubyModule | module to yield in |
| arg0 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| arg1 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| arg2 | org.jruby.runtime.builtin.IRubyObject | to pass to block |
| block | org.jruby.runtime.Block | to call |
| eval_type | org.jruby.EvalType | type of evaal to perform |
Returns: the result
syncVariables(org.jruby.runtime.builtin.IRubyObject other)Sync one this object's variables with other's - this is used to make rbClone work correctly.
syncVariables(List<org.jruby.runtime.builtin.Variable<Object>> variables)setTaint(boolean taint) · also: set_taintisTaint() · also: is_tainttainted_p(org.jruby.runtime.ThreadContext context)RubyBasicObject#to_s(ThreadContext) instead.
Returns: ""
isTrue() · also: is_trueIs this value a truthy value or not? Based on the #FALSE_F flag.
Returns: true it truthy
rb_obj_class Returns the real class of this object, excluding any singleton/meta class in the inheritance chain.
Returns: the real class
untaint(org.jruby.runtime.ThreadContext context)untrust(org.jruby.runtime.ThreadContext context)setUntrusted(boolean untrusted) · also: set_untrustedisUntrusted() · also: is_untrusteduntrusted_p(org.jruby.runtime.ThreadContext context)getVariableCount() · also: get_variable_countGets a list of all variables in this object.
getVariableNameList() · also: get_variable_name_listGets a name list of all variables in this object.
parallelStream()removeIf(java.util.function.Predicate<? super E> arg0)stream()toArray(java.util.function.IntFunction<T[]> arg0)| field | type | note |
|---|---|---|
| IVAR_INSPECTING_OBJECT_ALLOCATOR | ObjectAllocator | Allocator that inspects all methods for instance variables and chooses a concrete class to construct based on that. This allows using specialized subclasses to hold instance variables in fields rather than always holding them in an array. |
| OBJECT_ALLOCATOR | ObjectAllocator | Default allocator instance for all Ruby objects. The only reason to not use this allocator is if you actually need to have all instances of something be a subclass of RubyObject. |
| REIFYING_OBJECT_ALLOCATOR | ObjectAllocator |
attachToObjectSpace()Will make sure that this object is added to the current object space.
callInit(org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| args | org.jruby.runtime.builtin.IRubyObject[] | args |
| block | org.jruby.runtime.Block | block |
Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| block | org.jruby.runtime.Block | block |
callInit(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| arg0 | org.jruby.runtime.builtin.IRubyObject | arg0 |
| block | org.jruby.runtime.Block | block |
callInit(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)Call the Ruby initialize method with the supplied arguments and block.
| name | type | description |
|---|---|---|
| arg0 | org.jruby.runtime.builtin.IRubyObject | arg0 |
| arg1 | org.jruby.runtime.builtin.IRubyObject | arg1 |
| block | org.jruby.runtime.Block | block |
callInit(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)callInit(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)convertToType(org.jruby.RubyClass target, int convertMethodIndex)hashCode()This override does not do "checked" dispatch since Object usually has #hash defined.
Returns: the hash code
op_eqq(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)rb_equal The Ruby "===" method is used by default in case/when statements. The Object implementation first checks Java identity equality and then calls the "==" method too.
specificEval(org.jruby.runtime.ThreadContext context, org.jruby.RubyModule mod, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block, org.jruby.EvalType evalType)toRubyString(org.jruby.runtime.ThreadContext context)The default toString method is just a wrapper that calls the Ruby "to_s" method. This will raise if it is not actually a Ruby String.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | thread context this is executing on. |
Returns: the string.
toString()The default toString method is just a wrapper that calls the Ruby "to_s" method.
Returns: string representation
addFirst(E arg0)addLast(E arg0)getFirst() · also: get_firsthashCode()getLast() · also: get_lastremoveFirst()removeLast()replaceAll(java.util.function.UnaryOperator<E> arg0)reversed()sort(Comparator<? super E> arg0)spliterator()| field | type | note |
|---|---|---|
| ARRAY_DEFAULT_SIZE | int | |
| DEFAULT_INSPECT_STR_SIZE | int |
add(Object element)add(org.jruby.runtime.ThreadContext context, Object element)add(int index, Object element)addAll(Collection c)addAll(int index, Collection c)all_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)all_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)all_pCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)any_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)any_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)any_pCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)append(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject item)rb_ary_push - specialized rb_ary_store
Variable arity version for compatibility. Not bound to a Ruby method.
aref(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0)rb_ary_aref
aref(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)aref(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)aryAppend(org.jruby.runtime.ThreadContext context, org.jruby.RubyArray<?> y)Variable arity version for compatibility. Not bound to a Ruby method.
aset(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)aset(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)aset(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)RubyArray#aset(ThreadContext, IRubyObject, IRubyObject, IRubyObject) instead.
Returns: ""
aset(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)rb_ary_aset
assoc(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject key)rb_ary_assoc
RubyArray#at(ThreadContext, IRubyObject) instead.
Returns: ""
at(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject pos)rb_ary_at
bsearch(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)bsearch_index(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)clear()collect(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)collectArray(org.jruby.runtime.ThreadContext context, org.jruby.runtime.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()).
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current context |
| block | org.jruby.runtime.Block | a block for filtering or NULL_BLOCK |
Returns: an array of the filtered or unfiltered results
collectBang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_collect_bang
collect_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_collect_bang
collectEnum(org.jruby.runtime.ThreadContext context)Produce a new enumerator that will filter the contents of this array using #collectArray(ThreadContext, Block).
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current context |
Returns: an enumerator that will filter results
combination(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num, org.jruby.runtime.Block block)rb_ary_combination
compact(org.jruby.runtime.ThreadContext context)RubyArray#compact_bang(ThreadContext)
Returns: ""
compact_bang(org.jruby.runtime.ThreadContext context)rb_ary_compact_bang
compare(org.jruby.runtime.ThreadContext context, org.jruby.runtime.CallSite site, org.jruby.runtime.builtin.IRubyObject other)concat(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_concat
concat(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] objs)rb_ary_concat_multi
contains(Object element)containsAll(Collection c)copyInto(org.jruby.runtime.builtin.IRubyObject[] target, int start)copyInto(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] target, int start)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(org.jruby.runtime.builtin.IRubyObject[] target, int start, int len)copyInto(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] target, int start, int len)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.
count(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)count(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj, org.jruby.runtime.Block block)cycle(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_cycle
cycle(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)rb_ary_cycle
deconstruct(org.jruby.runtime.ThreadContext context)delete(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject item, org.jruby.runtime.Block block)rb_ary_delete
delete_at(org.jruby.runtime.ThreadContext context, int pos)rb_ary_delete_at
delete_at(org.jruby.runtime.builtin.IRubyObject obj)delete_at(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_delete_at_m
deleteIf(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_delete_if
delete_if(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)detectCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject ifnone, org.jruby.runtime.Block block)difference(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_ary_difference_multi
dig(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0)dig(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)dig(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)dig(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)drop(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject n)rb_ary_take
drop_while(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_take_while
Overridden dup for fast-path logic.
Returns: A new RubyArray sharing the original backing store.
each(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)mri: rb_ary_each
eachIndex(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_each_index
each_index(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)eachSlice(org.jruby.runtime.ThreadContext context, int size, org.jruby.runtime.Block block)each_slice(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)eltInternal(int offset)eltInternalSet(int offset, T item)eltOk(long offset)eltSetOk(long offset, T value)eltSetOk(int offset, T value)isEmpty() · also: is_emptyempty_p(org.jruby.runtime.ThreadContext context)rb_ary_empty_p
ensureCapacity(int minCapacity)Increases the capacity of this Array, if necessary.
| name | type | description |
|---|---|---|
| min_capacity | int | the desired minimum capacity of the internal array |
eql(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_eql
equals(Object other)fetch(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)Variable arity version for compatibility. Not bound to a Ruby method.
fetch(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)rb_ary_fetch
fetch(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)rb_ary_fetch
fetch_values(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)fill(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)fill(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)fill(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.Block block)fill(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2, org.jruby.runtime.builtin.IRubyObject arg3, org.jruby.runtime.Block block)find(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject ifnone, org.jruby.runtime.Block block)find_index(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)find_index(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject cond)Variable arity version for compatibility. Not bound to a Ruby method.
first(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0)flatten(org.jruby.runtime.ThreadContext context)flatten(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)flatten_bang(org.jruby.runtime.ThreadContext context)flatten_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)frozen_p(org.jruby.runtime.ThreadContext context)rb_ary_frozen_p
get(int index)rb_ary_hash
include_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject item)rb_ary_includes
includes(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject item)includesByEql(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject item)index(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_index
index(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj, org.jruby.runtime.Block unused)index(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)indexOf(Object element)indexes(org.jruby.runtime.builtin.IRubyObject[] args)indexes(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)initialize(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)Variable arity version for compatibility. Not bound to a Ruby method.
initialize(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_initialize
initialize(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.Block block)rb_ary_initialize
initialize(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.Block block)rb_ary_initialize
initialize_copy(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject orig)rb_ary_initialize_copy
insert(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg)rb_ary_insert
insert(org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)insert(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg1, org.jruby.runtime.builtin.IRubyObject arg2)insert(org.jruby.runtime.builtin.IRubyObject[] args)insert(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_ary_inspect
intersect_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)MRI: rb_ary_intersect_p
intersection(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)iterator()getJavaClass() · also: get_java_classjoin(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject sep)rb_ary_join
join19(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject sep)keep_if(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)Variable arity version for compatibility. Not bound to a Ruby method.
last(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0)rb_ary_last
lastIndexOf(Object element)getLength() · also: get_lengthrb_ary_length
Returns: a read-only copy of this list
listIterator()listIterator(int index)map(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)map_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_collect_bang
max(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)max(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num, org.jruby.runtime.Block block)min(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)min(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num, org.jruby.runtime.Block block)minmax(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_nitems
none_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)none_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)none_pCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)one_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)one_p(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)one_pCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg, org.jruby.runtime.Block block)op_and(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)MRI: rb_ary_and
op_cmp(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_cmp
op_diff(org.jruby.runtime.builtin.IRubyObject other)op_diff(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)rb_ary_diff
op_equal(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_equal
op_or(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject other)rb_ary_or
op_plus(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_plus
op_times(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject times)rb_ary_times
pack(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)pack(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj, org.jruby.runtime.builtin.IRubyObject maybeOpts)permutation(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num, org.jruby.runtime.Block block)rb_ary_permutation
permutation(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_pop
pop(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num)product(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_ary_product
product(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)push(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject item)push(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] items)push_m(org.jruby.runtime.builtin.IRubyObject[] items)rb_ary_push_m - instance method push
rassoc(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject value)rb_ary_rassoc
rb_clear(org.jruby.runtime.ThreadContext context)rb_ary_clear
rbCollect(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_collect
reject(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rejectBang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)reject_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rejectCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_reject_bang
remove(Object element)remove(int index)removeAll(Collection c)repeatedCombination(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num, org.jruby.runtime.Block block)repeated_permutation(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num, org.jruby.runtime.Block block)replace(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject orig)rb_ary_replace
retainAll(Collection c)reverse(org.jruby.runtime.ThreadContext context)reverse_bang(org.jruby.runtime.ThreadContext context)rb_ary_reverse_bang
reverseEach(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_reverse_each
reverse_each(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rindex(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj)rb_ary_rindex
rindex(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject obj, org.jruby.runtime.Block unused)rindex(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rotate(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject cnt)rotate_bang(org.jruby.runtime.ThreadContext context)rotate_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject cnt)Returns a stream of each IRubyObject
sample(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject sampleOrOpts)sample(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject sample, org.jruby.runtime.builtin.IRubyObject opts)sample(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)select(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)select_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)selectCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_select
set(int index, Object element)rb_ary_shift
shift(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject num)shuffle(org.jruby.runtime.ThreadContext context)shuffle(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject opts)shuffle(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)shuffle_bang(org.jruby.runtime.ThreadContext context)shuffle_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject opts)shuffle_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)size()slice_bang(org.jruby.runtime.builtin.IRubyObject[] args)Variable arity version for compatibility. Not bound to a Ruby method.
slice_bang(org.jruby.runtime.builtin.IRubyObject arg0)slice_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0)rb_ary_slice_bang
slice_bang(org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)slice_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject arg0, org.jruby.runtime.builtin.IRubyObject arg1)rb_ary_slice_bang
sort(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_sort
sort_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_sort_bang
sort_by_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_sort_by_bang
store(long index, org.jruby.runtime.builtin.IRubyObject value)store(org.jruby.runtime.ThreadContext context, long index, org.jruby.runtime.builtin.IRubyObject value)Store an element at the specified index or throw if the index is invalid.
| name | type | description |
|---|---|---|
| context | org.jruby.runtime.ThreadContext | the current thread context |
| index | long | the offset to store the value |
| value | org.jruby.runtime.builtin.IRubyObject | the value to be stored |
Returns: the value set
subList(int fromIndex, int toIndex)subseq(org.jruby.RubyClass metaClass, long beg, long len, boolean light)rb_ary_subseq
subseq_step(org.jruby.runtime.ThreadContext context, org.jruby.RubyArithmeticSequence arg0)rb_ary_subseq_step
sum(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)sum(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject init, org.jruby.runtime.Block block)sumCommon(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject init, org.jruby.runtime.Block block)take(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject n)rb_ary_take
take_while(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)rb_ary_take_while
rb_ary_to_a
toArray()toArray(Object[] arg)to_h(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)toJava(Class<T> target)RubyArray#toJavaArray(ThreadContext) instead.
Returns: ""
toJavaArray(org.jruby.runtime.ThreadContext context)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
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.
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.
rb_ary_to_s
transpose(org.jruby.runtime.ThreadContext context)rb_ary_transpose
union(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_ary_union_multi
rb_ary_uniq
uniq(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)uniq_bang(org.jruby.runtime.ThreadContext context)rb_ary_uniq_bang
uniq_bang(org.jruby.runtime.ThreadContext context, org.jruby.runtime.Block block)RubyArray#unshift(ThreadContext) instead
Returns: ""
unshift(org.jruby.runtime.ThreadContext context)unshift(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject item)rb_ary_unshift
unshift(org.jruby.runtime.builtin.IRubyObject[] items)unshift(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] items)values_at(org.jruby.runtime.builtin.IRubyObject[] args)values_at(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args)rb_values_at
zip(org.jruby.runtime.ThreadContext context, org.jruby.runtime.builtin.IRubyObject[] args, org.jruby.runtime.Block block)rb_ary_zip