org.jruby
Class RubyArray
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyArray
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IRubyObject>, java.lang.Iterable, java.util.Collection, java.util.List, InstanceVariables, InternalVariables, IRubyObject, CoreObjectType
public class RubyArray
- extends RubyObject
- implements java.util.List
The implementation of the built-in class Array in Ruby.
Concurrency: no synchronization is required among readers, but
all users must synchronize externally with writers.
- See Also:
- Serialized Form
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, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F |
Method Summary |
void |
add(int index,
java.lang.Object element)
|
boolean |
add(java.lang.Object element)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
IRubyObject |
all_p(ThreadContext context,
Block block)
|
IRubyObject |
any_p(ThreadContext context,
Block block)
|
RubyArray |
append(IRubyObject item)
rb_ary_push - specialized rb_ary_store |
IRubyObject |
aref(IRubyObject arg0)
rb_ary_aref |
IRubyObject |
aref(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args. |
IRubyObject |
aref(IRubyObject arg0,
IRubyObject arg1)
|
IRubyObject |
aref19(IRubyObject arg0)
|
IRubyObject |
aref19(IRubyObject arg0,
IRubyObject arg1)
|
RubyArray |
aryDup()
rb_ary_dup |
IRubyObject |
aset(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args. |
IRubyObject |
aset(IRubyObject arg0,
IRubyObject arg1)
|
IRubyObject |
aset(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2)
rb_ary_aset |
IRubyObject |
aset19(IRubyObject arg0,
IRubyObject arg1)
|
IRubyObject |
aset19(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2)
|
IRubyObject |
assoc(ThreadContext context,
IRubyObject key)
rb_ary_assoc |
IRubyObject |
at(IRubyObject pos)
rb_ary_at |
IRubyObject |
checkArrayType()
rb_check_array_type
Returns the result of trying to convert this object to an Array
with "to_ary". |
IRubyObject |
choice(ThreadContext context)
|
void |
clear()
|
IRubyObject |
collect_bang(ThreadContext context,
Block block)
rb_ary_collect_bang |
IRubyObject |
collect(ThreadContext context,
Block block)
rb_ary_collect |
IRubyObject |
collect19(ThreadContext context,
Block block)
|
RubyArray |
collectBang(ThreadContext context,
Block block)
rb_ary_collect_bang |
IRubyObject |
combination(ThreadContext context,
IRubyObject num,
Block block)
rb_ary_combination |
IRubyObject |
compact_bang()
rb_ary_compact_bang |
IRubyObject |
compact()
rb_ary_compact |
RubyBoolean |
compare(ThreadContext context,
java.lang.String method,
IRubyObject other,
java.util.Set<RecursiveComparator.Pair> seen)
|
RubyArray |
concat(IRubyObject obj)
rb_ary_concat |
RubyArray |
concat19(IRubyObject obj)
|
boolean |
contains(java.lang.Object element)
|
boolean |
containsAll(java.util.Collection c)
|
RubyArray |
convertToArray()
Tries to convert this object to a Ruby Array using the "to_ary"
method. |
IRubyObject |
count(ThreadContext context,
Block block)
|
IRubyObject |
count(ThreadContext context,
IRubyObject obj,
Block block)
|
static IRubyObject |
create(IRubyObject klass,
IRubyObject[] args,
Block block)
rb_ary_s_create |
static RubyClass |
createArrayClass(Ruby runtime)
|
IRubyObject |
cycle(ThreadContext context,
Block block)
rb_ary_cycle |
IRubyObject |
cycle(ThreadContext context,
IRubyObject arg,
Block block)
rb_ary_cycle |
IRubyObject |
delete_at(IRubyObject obj)
rb_ary_delete_at_m |
IRubyObject |
delete_if(ThreadContext context,
Block block)
|
IRubyObject |
delete(ThreadContext context,
IRubyObject item,
Block block)
rb_ary_delete |
IRubyObject |
deleteIf(ThreadContext context,
Block block)
rb_ary_delete_if |
IRubyObject |
detectCommon(ThreadContext context,
IRubyObject ifnone,
Block block)
|
IRubyObject |
drop_while(ThreadContext context,
Block block)
rb_ary_take_while |
IRubyObject |
drop(ThreadContext context,
IRubyObject n)
rb_ary_take |
IRubyObject |
dup()
Overridden dup for fast-path logic. |
IRubyObject |
each_index(ThreadContext context,
Block block)
|
IRubyObject |
each_slice(ThreadContext context,
IRubyObject arg,
Block block)
|
IRubyObject |
each(ThreadContext context,
Block block)
|
IRubyObject |
eachCommon(ThreadContext context,
Block block)
rb_ary_each |
IRubyObject |
eachIndex(ThreadContext context,
Block block)
rb_ary_each_index |
IRubyObject |
eachSlice(ThreadContext context,
int size,
Block block)
|
IRubyObject |
eltInternal(int offset)
|
IRubyObject |
eltInternalSet(int offset,
IRubyObject item)
|
IRubyObject |
eltOk(long offset)
|
IRubyObject |
empty_p()
rb_ary_empty_p |
IRubyObject |
entry(int offset)
|
IRubyObject |
entry(long offset)
rb_ary_entry |
IRubyObject |
eql(ThreadContext context,
IRubyObject obj)
rb_ary_eql |
IRubyObject |
fetch(ThreadContext context,
IRubyObject[] args,
Block block)
Deprecated. Use the versions with zero, one, or two args. |
IRubyObject |
fetch(ThreadContext context,
IRubyObject arg0,
Block block)
rb_ary_fetch |
IRubyObject |
fetch(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block)
rb_ary_fetch |
IRubyObject |
fill(ThreadContext context,
Block block)
|
IRubyObject |
fill(ThreadContext context,
IRubyObject arg,
Block block)
|
IRubyObject |
fill(ThreadContext context,
IRubyObject arg1,
IRubyObject arg2,
Block block)
|
IRubyObject |
fill(ThreadContext context,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
Block block)
|
IRubyObject |
find_index(ThreadContext context,
Block block)
|
IRubyObject |
find_index(ThreadContext context,
IRubyObject cond)
|
IRubyObject |
find(ThreadContext context,
IRubyObject ifnone,
Block block)
|
IRubyObject |
first()
rb_ary_first |
IRubyObject |
first(IRubyObject arg0)
rb_ary_first |
IRubyObject |
first(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args. |
IRubyObject |
flatten_bang(ThreadContext context)
|
IRubyObject |
flatten_bang(ThreadContext context,
IRubyObject arg)
|
IRubyObject |
flatten_bang19(ThreadContext context)
|
IRubyObject |
flatten_bang19(ThreadContext context,
IRubyObject arg)
|
IRubyObject |
flatten(ThreadContext context)
|
IRubyObject |
flatten(ThreadContext context,
IRubyObject arg)
|
IRubyObject |
flatten19(ThreadContext context)
|
IRubyObject |
flatten19(ThreadContext context,
IRubyObject arg)
|
RubyBoolean |
frozen_p(ThreadContext context)
rb_ary_frozen_p |
java.lang.Object |
get(int index)
|
java.lang.Class |
getJavaClass()
Will return the Java interface that most closely can represent
this object, when working through JAva integration
translations. |
int |
getLength()
|
java.util.List |
getList()
Getter for property list. |
int |
getNativeTypeIndex()
This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are. |
RArray |
getRArray()
|
RubyFixnum |
hash(ThreadContext context)
rb_ary_hash |
RubyFixnum |
hash19(ThreadContext context)
rb_ary_hash |
RubyBoolean |
include_p(ThreadContext context,
IRubyObject item)
rb_ary_includes |
boolean |
includes(ThreadContext context,
IRubyObject item)
|
IRubyObject |
index(ThreadContext context,
Block block)
|
IRubyObject |
index(ThreadContext context,
IRubyObject obj)
rb_ary_index |
IRubyObject |
index(ThreadContext context,
IRubyObject obj,
Block unused)
|
IRubyObject |
indexes(IRubyObject[] args)
rb_ary_indexes |
int |
indexOf(java.lang.Object element)
|
IRubyObject |
initialize_copy(IRubyObject orig)
rb_ary_initialize_copy |
IRubyObject |
initialize(ThreadContext context,
Block block)
rb_ary_initialize |
IRubyObject |
initialize(ThreadContext context,
IRubyObject[] args,
Block block)
Deprecated. Use the versions with zero, one, or two args. |
IRubyObject |
initialize(ThreadContext context,
IRubyObject arg0,
Block block)
rb_ary_initialize |
IRubyObject |
initialize(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block)
rb_ary_initialize |
IRubyObject |
insert()
|
IRubyObject |
insert(IRubyObject arg)
rb_ary_insert |
IRubyObject |
insert(IRubyObject[] args)
|
IRubyObject |
insert(IRubyObject arg1,
IRubyObject arg2)
|
IRubyObject |
insert19(IRubyObject arg)
|
IRubyObject |
insert19(IRubyObject[] args)
|
IRubyObject |
insert19(IRubyObject arg1,
IRubyObject arg2)
|
IRubyObject |
inspect()
rb_ary_inspect |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
IRubyObject |
join(ThreadContext context)
|
IRubyObject |
join(ThreadContext context,
IRubyObject sep)
rb_ary_join |
IRubyObject |
join19(ThreadContext context)
|
IRubyObject |
join19(ThreadContext context,
IRubyObject sep)
rb_ary_join |
IRubyObject |
keep_if(ThreadContext context,
Block block)
|
IRubyObject |
last()
rb_ary_last |
IRubyObject |
last(IRubyObject arg0)
rb_ary_last |
IRubyObject |
last(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args. |
int |
lastIndexOf(java.lang.Object element)
|
RubyFixnum |
length()
rb_ary_length |
java.util.ListIterator |
listIterator()
|
java.util.ListIterator |
listIterator(int index)
|
IRubyObject |
map_bang(ThreadContext context,
Block block)
rb_ary_collect_bang |
static void |
marshalTo(RubyArray array,
MarshalStream output)
|
static RubyArray |
newArray(Ruby runtime)
rb_ary_new |
static RubyArray |
newArray(Ruby runtime,
java.util.Collection<? extends IRubyObject> collection)
|
static RubyArray |
newArray(Ruby runtime,
int len)
|
static RubyArray |
newArray(Ruby runtime,
IRubyObject obj)
|
static RubyArray |
newArray(Ruby runtime,
IRubyObject[] args)
rb_ary_new4, rb_ary_new3 |
static RubyArray |
newArray(Ruby runtime,
IRubyObject car,
IRubyObject cdr)
rb_assoc_new |
static RubyArray |
newArray(Ruby runtime,
long len)
rb_ary_new2 |
static RubyArray |
newArrayLight(Ruby runtime)
rb_ary_new |
static RubyArray |
newArrayLight(Ruby runtime,
int len)
|
static RubyArray |
newArrayLight(Ruby runtime,
IRubyObject... objs)
|
static RubyArray |
newArrayLight(Ruby runtime,
IRubyObject obj)
|
static RubyArray |
newArrayLight(Ruby runtime,
long len)
|
static RubyArray |
newArrayNoCopy(Ruby runtime,
IRubyObject[] args)
|
static RubyArray |
newArrayNoCopy(Ruby runtime,
IRubyObject[] args,
int begin)
|
static RubyArray |
newArrayNoCopy(Ruby runtime,
IRubyObject[] args,
int begin,
int length)
|
static RubyArray |
newArrayNoCopyLight(Ruby runtime,
IRubyObject[] args)
|
static RubyArray |
newEmptyArray(Ruby runtime)
|
IRubyObject |
nitems()
rb_ary_nitems |
IRubyObject |
op_and(IRubyObject other)
rb_ary_and |
IRubyObject |
op_cmp(ThreadContext context,
IRubyObject obj)
rb_ary_cmp |
IRubyObject |
op_diff(IRubyObject other)
rb_ary_diff |
IRubyObject |
op_equal(ThreadContext context,
IRubyObject obj)
rb_ary_equal |
IRubyObject |
op_or(IRubyObject other)
rb_ary_or |
IRubyObject |
op_plus(IRubyObject obj)
rb_ary_plus |
IRubyObject |
op_times(ThreadContext context,
IRubyObject times)
rb_ary_times |
IRubyObject |
op_times19(ThreadContext context,
IRubyObject times)
rb_ary_times |
RubyString |
pack(ThreadContext context,
IRubyObject obj)
|
RubyString |
pack19(ThreadContext context,
IRubyObject obj)
|
IRubyObject |
permutation(ThreadContext context,
Block block)
|
IRubyObject |
permutation(ThreadContext context,
IRubyObject num,
Block block)
rb_ary_permutation |
IRubyObject |
pop(ThreadContext context)
rb_ary_pop |
IRubyObject |
pop(ThreadContext context,
IRubyObject num)
|
IRubyObject |
product(ThreadContext context,
IRubyObject[] args)
rb_ary_product |
IRubyObject |
product19(ThreadContext context,
IRubyObject[] args,
Block block)
|
RubyArray |
push_m(IRubyObject[] items)
rb_ary_push_m - instance method push |
RubyArray |
push_m19(IRubyObject[] items)
|
IRubyObject |
rassoc(ThreadContext context,
IRubyObject value)
rb_ary_rassoc |
IRubyObject |
rb_clear()
rb_ary_clear |
IRubyObject |
reject_bang(ThreadContext context,
Block block)
|
IRubyObject |
reject(ThreadContext context,
Block block)
|
IRubyObject |
rejectBang(ThreadContext context,
Block block)
rb_ary_reject_bang |
IRubyObject |
rejectCommon(ThreadContext context,
Block block)
rb_ary_reject_bang |
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object element)
|
boolean |
removeAll(java.util.Collection c)
|
IRubyObject |
repeated_permutation(ThreadContext context,
Block block)
|
IRubyObject |
repeated_permutation(ThreadContext context,
IRubyObject num,
Block block)
|
IRubyObject |
repeatedCombination(ThreadContext context,
IRubyObject num,
Block block)
|
IRubyObject |
replace(IRubyObject orig)
rb_ary_replace |
boolean |
retainAll(java.util.Collection c)
|
IRubyObject |
reverse_bang()
rb_ary_reverse_bang |
IRubyObject |
reverse_each(ThreadContext context,
Block block)
|
IRubyObject |
reverse()
rb_ary_reverse_m |
IRubyObject |
reverseEach(ThreadContext context,
Block block)
rb_ary_reverse_each |
IRubyObject |
rindex(ThreadContext context,
Block block)
|
IRubyObject |
rindex(ThreadContext context,
IRubyObject obj)
rb_ary_rindex |
IRubyObject |
rindex(ThreadContext context,
IRubyObject obj,
Block unused)
|
IRubyObject |
rotate_bang(ThreadContext context)
|
IRubyObject |
rotate_bang(ThreadContext context,
IRubyObject cnt)
|
IRubyObject |
rotate(ThreadContext context)
|
IRubyObject |
rotate(ThreadContext context,
IRubyObject cnt)
|
IRubyObject |
sample(ThreadContext context,
IRubyObject nv)
|
IRubyObject |
sample(ThreadContext context,
IRubyObject[] args)
|
IRubyObject |
select_bang(ThreadContext context,
Block block)
|
IRubyObject |
select(ThreadContext context,
Block block)
|
IRubyObject |
selectCommon(ThreadContext context,
Block block)
rb_ary_select |
java.lang.Object |
set(int index,
java.lang.Object element)
|
void |
setRArray(RArray rarray)
|
IRubyObject |
shift(ThreadContext context)
rb_ary_shift |
IRubyObject |
shift(ThreadContext context,
IRubyObject num)
|
IRubyObject |
shuffle_bang(ThreadContext context)
|
IRubyObject |
shuffle_bang(ThreadContext context,
IRubyObject[] args)
|
IRubyObject |
shuffle(ThreadContext context)
|
IRubyObject |
shuffle(ThreadContext context,
IRubyObject[] args)
|
int |
size()
|
IRubyObject |
slice_bang(IRubyObject arg0)
rb_ary_slice_bang |
IRubyObject |
slice_bang(IRubyObject[] args)
Deprecated. Use the versions with zero, one, or two args. |
IRubyObject |
slice_bang(IRubyObject arg0,
IRubyObject arg1)
rb_ary_slice_bang |
IRubyObject |
sort_bang(ThreadContext context,
Block block)
rb_ary_sort_bang |
IRubyObject |
sort_bang19(ThreadContext context,
Block block)
|
IRubyObject |
sort_by_bang(ThreadContext context,
Block block)
rb_ary_sort_by_bang |
RubyArray |
sort(ThreadContext context,
Block block)
rb_ary_sort |
RubyArray |
sort19(ThreadContext context,
Block block)
|
IRubyObject |
store(long index,
IRubyObject value)
rb_ary_store |
java.util.List |
subList(int fromIndex,
int toIndex)
|
IRubyObject |
subseq(long beg,
long len)
rb_ary_subseq |
IRubyObject |
subseqLight(long beg,
long len)
rb_ary_subseq |
IRubyObject |
take_while(ThreadContext context,
Block block)
rb_ary_take_while |
IRubyObject |
take(ThreadContext context,
IRubyObject n)
rb_ary_take |
RubyArray |
to_a()
rb_ary_to_a |
IRubyObject |
to_ary()
|
IRubyObject |
to_s()
rb_ary_to_s |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] arg)
|
java.lang.Object |
toJava(java.lang.Class target)
Convert the object to the specified Java class, if possible. |
IRubyObject[] |
toJavaArray()
|
IRubyObject[] |
toJavaArrayMaybeUnsafe()
|
IRubyObject[] |
toJavaArrayUnsafe()
|
RubyArray |
transpose()
rb_ary_transpose |
static IRubyObject |
try_convert(ThreadContext context,
IRubyObject self,
IRubyObject arg)
|
IRubyObject |
uniq_bang(ThreadContext context)
rb_ary_uniq_bang |
IRubyObject |
uniq_bang19(ThreadContext context,
Block block)
|
IRubyObject |
uniq(ThreadContext context)
rb_ary_uniq |
IRubyObject |
uniq19(ThreadContext context,
Block block)
|
static RubyArray |
unmarshalFrom(UnmarshalStream input)
|
IRubyObject |
unshift()
|
IRubyObject |
unshift(IRubyObject item)
rb_ary_unshift |
IRubyObject |
unshift(IRubyObject[] items)
|
IRubyObject |
unshift19()
|
IRubyObject |
unshift19(IRubyObject item)
|
IRubyObject |
unshift19(IRubyObject[] items)
|
IRubyObject |
values_at(IRubyObject[] args)
rb_values_at |
IRubyObject |
zip(ThreadContext context,
IRubyObject[] args,
Block block)
rb_ary_zip |
Methods inherited from class org.jruby.RubyObject |
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, op_eqq, puts, specificEval, toString |
Methods inherited from class org.jruby.RubyBasicObject |
addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkCallMethod, checkFrozen, checkStringType, checkStringType19, compareTo, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, createBasicObjectClass, dataGetStruct, dataGetStructChecked, dataWrapStruct, display, ensureInstanceVariablesSettable, eql_p, eql, equal_p, equal_p19, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, freeze, getFlag, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getMetaClass, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hashyInspect, hasInstanceVariable, hasInternalVariable, hasVariables, id_deprecated, id, infectBy, initialize19, initialize19, initialize19, initialize19, initialize19, initObjectId, inspectHashCode, 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, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, method_missing19, method, method19, methods, methods, methods19, nil_p, op_equal_19, op_match, op_match19, op_not_equal, op_not_match, op_not, private_methods, private_methods19, protected_methods, protected_methods19, public_methods, public_methods19, rbClone, 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, send19, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setTaint, setUntrusted, setVariable, singleton_method_added19, singleton_method_removed19, singleton_method_undefined19, singleton_methods, singleton_methods19, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, trust, type_deprecated, type, untaint, untrust, untrusted_p, 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.List |
equals, hashCode |
ARRAY_DEFAULT_SIZE
public static final int ARRAY_DEFAULT_SIZE
- See Also:
- Constant Field Values
createArrayClass
public static RubyClass createArrayClass(Ruby runtime)
getNativeTypeIndex
public int getNativeTypeIndex()
- Description copied from class:
RubyObject
- This is overridden in the other concrete Java builtins to provide a fast way
to determine what type they are.
Will generally return a value from org.jruby.runtime.ClassIndex
- Specified by:
getNativeTypeIndex
in interface CoreObjectType
- Overrides:
getNativeTypeIndex
in class RubyObject
- Returns:
- the ClassIndex of the native type this object was constructed from
- See Also:
org.jruby.runtime.ClassInde
create
public static IRubyObject create(IRubyObject klass,
IRubyObject[] args,
Block block)
- rb_ary_s_create
newArray
public static final RubyArray newArray(Ruby runtime,
long len)
- rb_ary_new2
newArrayLight
public static final RubyArray newArrayLight(Ruby runtime,
long len)
newArray
public static final RubyArray newArray(Ruby runtime,
int len)
newArrayLight
public static final RubyArray newArrayLight(Ruby runtime,
int len)
newArray
public static final RubyArray newArray(Ruby runtime)
- rb_ary_new
newArrayLight
public static final RubyArray newArrayLight(Ruby runtime)
- rb_ary_new
newArray
public static RubyArray newArray(Ruby runtime,
IRubyObject obj)
newArrayLight
public static RubyArray newArrayLight(Ruby runtime,
IRubyObject obj)
newArrayLight
public static RubyArray newArrayLight(Ruby runtime,
IRubyObject... objs)
newArray
public static RubyArray newArray(Ruby runtime,
IRubyObject car,
IRubyObject cdr)
- rb_assoc_new
newEmptyArray
public static RubyArray newEmptyArray(Ruby runtime)
newArray
public static RubyArray newArray(Ruby runtime,
IRubyObject[] args)
- rb_ary_new4, rb_ary_new3
newArrayNoCopy
public static RubyArray newArrayNoCopy(Ruby runtime,
IRubyObject[] args)
newArrayNoCopy
public static RubyArray newArrayNoCopy(Ruby runtime,
IRubyObject[] args,
int begin)
newArrayNoCopy
public static RubyArray newArrayNoCopy(Ruby runtime,
IRubyObject[] args,
int begin,
int length)
newArrayNoCopyLight
public static RubyArray newArrayNoCopyLight(Ruby runtime,
IRubyObject[] args)
newArray
public static RubyArray newArray(Ruby runtime,
java.util.Collection<? extends IRubyObject> collection)
getList
public java.util.List getList()
- Getter for property list.
- Returns:
- Value of property list.
getLength
public int getLength()
setRArray
public void setRArray(RArray rarray)
getRArray
public RArray getRArray()
toJavaArray
public IRubyObject[] toJavaArray()
toJavaArrayUnsafe
public IRubyObject[] toJavaArrayUnsafe()
toJavaArrayMaybeUnsafe
public IRubyObject[] toJavaArrayMaybeUnsafe()
initialize
public IRubyObject initialize(ThreadContext context,
IRubyObject[] args,
Block block)
- Deprecated. Use the versions with zero, one, or two args.
- Variable arity version for compatibility. Not bound to a Ruby method.
initialize
public IRubyObject initialize(ThreadContext context,
Block block)
- rb_ary_initialize
initialize
public IRubyObject initialize(ThreadContext context,
IRubyObject arg0,
Block block)
- rb_ary_initialize
initialize
public IRubyObject initialize(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block)
- rb_ary_initialize
initialize_copy
public IRubyObject initialize_copy(IRubyObject orig)
- rb_ary_initialize_copy
- Overrides:
initialize_copy
in class RubyBasicObject
dup
public IRubyObject dup()
- Overridden dup for fast-path logic.
- Specified by:
dup
in interface IRubyObject
- Overrides:
dup
in class RubyBasicObject
- Returns:
- A new RubyArray sharing the original backing store.
replace
public IRubyObject replace(IRubyObject orig)
- rb_ary_replace
to_s
public IRubyObject to_s()
- rb_ary_to_s
- Overrides:
to_s
in class RubyBasicObject
includes
public boolean includes(ThreadContext context,
IRubyObject item)
hash
public RubyFixnum hash(ThreadContext context)
- rb_ary_hash
hash19
public RubyFixnum hash19(ThreadContext context)
- rb_ary_hash
store
public final IRubyObject store(long index,
IRubyObject value)
- rb_ary_store
eltOk
public final IRubyObject eltOk(long offset)
entry
public final IRubyObject entry(long offset)
- rb_ary_entry
entry
public final IRubyObject entry(int offset)
eltInternal
public final IRubyObject eltInternal(int offset)
eltInternalSet
public final IRubyObject eltInternalSet(int offset,
IRubyObject item)
fetch
public IRubyObject fetch(ThreadContext context,
IRubyObject[] args,
Block block)
- Deprecated. Use the versions with zero, one, or two args.
- Variable arity version for compatibility. Not bound to a Ruby method.
fetch
public IRubyObject fetch(ThreadContext context,
IRubyObject arg0,
Block block)
- rb_ary_fetch
fetch
public IRubyObject fetch(ThreadContext context,
IRubyObject arg0,
IRubyObject arg1,
Block block)
- rb_ary_fetch
insert
public IRubyObject insert()
insert
public IRubyObject insert(IRubyObject arg)
- rb_ary_insert
insert19
public IRubyObject insert19(IRubyObject arg)
insert
public IRubyObject insert(IRubyObject arg1,
IRubyObject arg2)
insert19
public IRubyObject insert19(IRubyObject arg1,
IRubyObject arg2)
insert
public IRubyObject insert(IRubyObject[] args)
insert19
public IRubyObject insert19(IRubyObject[] args)
aryDup
public final RubyArray aryDup()
- rb_ary_dup
transpose
public RubyArray transpose()
- rb_ary_transpose
values_at
public IRubyObject values_at(IRubyObject[] args)
- rb_values_at
subseq
public IRubyObject subseq(long beg,
long len)
- rb_ary_subseq
subseqLight
public IRubyObject subseqLight(long beg,
long len)
- rb_ary_subseq
length
public RubyFixnum length()
- rb_ary_length
append
public RubyArray append(IRubyObject item)
- rb_ary_push - specialized rb_ary_store
push_m
public RubyArray push_m(IRubyObject[] items)
- rb_ary_push_m - instance method push
push_m19
public RubyArray push_m19(IRubyObject[] items)
pop
public IRubyObject pop(ThreadContext context)
- rb_ary_pop
pop
public IRubyObject pop(ThreadContext context,
IRubyObject num)
shift
public IRubyObject shift(ThreadContext context)
- rb_ary_shift
shift
public IRubyObject shift(ThreadContext context,
IRubyObject num)
unshift
public IRubyObject unshift()
unshift19
public IRubyObject unshift19()
unshift
public IRubyObject unshift(IRubyObject item)
- rb_ary_unshift
unshift19
public IRubyObject unshift19(IRubyObject item)
unshift
public IRubyObject unshift(IRubyObject[] items)
unshift19
public IRubyObject unshift19(IRubyObject[] items)
include_p
public RubyBoolean include_p(ThreadContext context,
IRubyObject item)
- rb_ary_includes
frozen_p
public RubyBoolean frozen_p(ThreadContext context)
- rb_ary_frozen_p
- Overrides:
frozen_p
in class RubyBasicObject
aref
public IRubyObject aref(IRubyObject[] args)
- Deprecated. Use the versions with zero, one, or two args.
- Variable arity version for compatibility. Not bound to a Ruby method.
aref
public IRubyObject aref(IRubyObject arg0)
- rb_ary_aref
aref19
public IRubyObject aref19(IRubyObject arg0)
aref
public IRubyObject aref(IRubyObject arg0,
IRubyObject arg1)
aref19
public IRubyObject aref19(IRubyObject arg0,
IRubyObject arg1)
aset
public IRubyObject aset(IRubyObject[] args)
- Deprecated. Use the versions with zero, one, or two args.
- Variable arity version for compatibility. Not bound to a Ruby method.
aset
public IRubyObject aset(IRubyObject arg0,
IRubyObject arg1)
aset19
public IRubyObject aset19(IRubyObject arg0,
IRubyObject arg1)
aset
public IRubyObject aset(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2)
- rb_ary_aset
aset19
public IRubyObject aset19(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2)
at
public IRubyObject at(IRubyObject pos)
- rb_ary_at
concat
public RubyArray concat(IRubyObject obj)
- rb_ary_concat
concat19
public RubyArray concat19(IRubyObject obj)
inspect
public IRubyObject inspect()
- rb_ary_inspect
- Specified by:
inspect
in interface IRubyObject
- Overrides:
inspect
in class RubyBasicObject
- Returns:
- String
first
public IRubyObject first(IRubyObject[] args)
- Deprecated. Use the versions with zero, one, or two args.
- Variable arity version for compatibility. Not bound to a Ruby method.
first
public IRubyObject first()
- rb_ary_first
first
public IRubyObject first(IRubyObject arg0)
- rb_ary_first
last
public IRubyObject last(IRubyObject[] args)
- Deprecated. Use the versions with zero, one, or two args.
- Variable arity version for compatibility. Not bound to a Ruby method.
last
public IRubyObject last()
- rb_ary_last
last
public IRubyObject last(IRubyObject arg0)
- rb_ary_last
eachCommon
public IRubyObject eachCommon(ThreadContext context,
Block block)
- rb_ary_each
each
public IRubyObject each(ThreadContext context,
Block block)
eachSlice
public IRubyObject eachSlice(ThreadContext context,
int size,
Block block)
each_slice
public IRubyObject each_slice(ThreadContext context,
IRubyObject arg,
Block block)
eachIndex
public IRubyObject eachIndex(ThreadContext context,
Block block)
- rb_ary_each_index
each_index
public IRubyObject each_index(ThreadContext context,
Block block)
reverseEach
public IRubyObject reverseEach(ThreadContext context,
Block block)
- rb_ary_reverse_each
reverse_each
public IRubyObject reverse_each(ThreadContext context,
Block block)
join
public IRubyObject join(ThreadContext context,
IRubyObject sep)
- rb_ary_join
join
public IRubyObject join(ThreadContext context)
join19
public IRubyObject join19(ThreadContext context,
IRubyObject sep)
- rb_ary_join
join19
public IRubyObject join19(ThreadContext context)
to_a
public RubyArray to_a()
- rb_ary_to_a
- Overrides:
to_a
in class RubyBasicObject
to_ary
public IRubyObject to_ary()
convertToArray
public RubyArray convertToArray()
- Description copied from class:
RubyBasicObject
- Tries to convert this object to a Ruby Array using the "to_ary"
method.
- Specified by:
convertToArray
in interface IRubyObject
- Overrides:
convertToArray
in class RubyBasicObject
- Returns:
checkArrayType
public IRubyObject checkArrayType()
- Description copied from class:
RubyBasicObject
- rb_check_array_type
Returns the result of trying to convert this object to an Array
with "to_ary".
- Specified by:
checkArrayType
in interface IRubyObject
- Overrides:
checkArrayType
in class RubyBasicObject
- Returns:
op_equal
public IRubyObject op_equal(ThreadContext context,
IRubyObject obj)
- rb_ary_equal
- Specified by:
op_equal
in interface IRubyObject
- Overrides:
op_equal
in class RubyBasicObject
compare
public RubyBoolean compare(ThreadContext context,
java.lang.String method,
IRubyObject other,
java.util.Set<RecursiveComparator.Pair> seen)
eql
public IRubyObject eql(ThreadContext context,
IRubyObject obj)
- rb_ary_eql
compact_bang
public IRubyObject compact_bang()
- rb_ary_compact_bang
compact
public IRubyObject compact()
- rb_ary_compact
empty_p
public IRubyObject empty_p()
- rb_ary_empty_p
rb_clear
public IRubyObject rb_clear()
- rb_ary_clear
fill
public IRubyObject fill(ThreadContext context,
Block block)
fill
public IRubyObject fill(ThreadContext context,
IRubyObject arg,
Block block)
fill
public IRubyObject fill(ThreadContext context,
IRubyObject arg1,
IRubyObject arg2,
Block block)
fill
public IRubyObject fill(ThreadContext context,
IRubyObject arg1,
IRubyObject arg2,
IRubyObject arg3,
Block block)
index
public IRubyObject index(ThreadContext context,
IRubyObject obj)
- rb_ary_index
index
public IRubyObject index(ThreadContext context,
IRubyObject obj,
Block unused)
index
public IRubyObject index(ThreadContext context,
Block block)
rindex
public IRubyObject rindex(ThreadContext context,
IRubyObject obj)
- rb_ary_rindex
rindex
public IRubyObject rindex(ThreadContext context,
IRubyObject obj,
Block unused)
rindex
public IRubyObject rindex(ThreadContext context,
Block block)
indexes
public IRubyObject indexes(IRubyObject[] args)
- rb_ary_indexes
reverse_bang
public IRubyObject reverse_bang()
- rb_ary_reverse_bang
reverse
public IRubyObject reverse()
- rb_ary_reverse_m
collect
public IRubyObject collect(ThreadContext context,
Block block)
- rb_ary_collect
collect19
public IRubyObject collect19(ThreadContext context,
Block block)
collectBang
public RubyArray collectBang(ThreadContext context,
Block block)
- rb_ary_collect_bang
collect_bang
public IRubyObject collect_bang(ThreadContext context,
Block block)
- rb_ary_collect_bang
map_bang
public IRubyObject map_bang(ThreadContext context,
Block block)
- rb_ary_collect_bang
selectCommon
public IRubyObject selectCommon(ThreadContext context,
Block block)
- rb_ary_select
select
public IRubyObject select(ThreadContext context,
Block block)
select_bang
public IRubyObject select_bang(ThreadContext context,
Block block)
keep_if
public IRubyObject keep_if(ThreadContext context,
Block block)
delete
public IRubyObject delete(ThreadContext context,
IRubyObject item,
Block block)
- rb_ary_delete
delete_at
public IRubyObject delete_at(IRubyObject obj)
- rb_ary_delete_at_m
rejectCommon
public IRubyObject rejectCommon(ThreadContext context,
Block block)
- rb_ary_reject_bang
reject
public IRubyObject reject(ThreadContext context,
Block block)
rejectBang
public IRubyObject rejectBang(ThreadContext context,
Block block)
- rb_ary_reject_bang
reject_bang
public IRubyObject reject_bang(ThreadContext context,
Block block)
deleteIf
public IRubyObject deleteIf(ThreadContext context,
Block block)
- rb_ary_delete_if
delete_if
public IRubyObject delete_if(ThreadContext context,
Block block)
zip
public IRubyObject zip(ThreadContext context,
IRubyObject[] args,
Block block)
- rb_ary_zip
op_cmp
public IRubyObject op_cmp(ThreadContext context,
IRubyObject obj)
- rb_ary_cmp
- Overrides:
op_cmp
in class RubyBasicObject
slice_bang
public IRubyObject slice_bang(IRubyObject[] args)
- Deprecated. Use the versions with zero, one, or two args.
- Variable arity version for compatibility. Not bound to a Ruby method.
slice_bang
public IRubyObject slice_bang(IRubyObject arg0)
- rb_ary_slice_bang
slice_bang
public IRubyObject slice_bang(IRubyObject arg0,
IRubyObject arg1)
- rb_ary_slice_bang
assoc
public IRubyObject assoc(ThreadContext context,
IRubyObject key)
- rb_ary_assoc
rassoc
public IRubyObject rassoc(ThreadContext context,
IRubyObject value)
- rb_ary_rassoc
flatten_bang
public IRubyObject flatten_bang(ThreadContext context)
flatten_bang19
public IRubyObject flatten_bang19(ThreadContext context)
flatten_bang
public IRubyObject flatten_bang(ThreadContext context,
IRubyObject arg)
flatten_bang19
public IRubyObject flatten_bang19(ThreadContext context,
IRubyObject arg)
flatten
public IRubyObject flatten(ThreadContext context)
flatten
public IRubyObject flatten(ThreadContext context,
IRubyObject arg)
flatten19
public IRubyObject flatten19(ThreadContext context)
flatten19
public IRubyObject flatten19(ThreadContext context,
IRubyObject arg)
count
public IRubyObject count(ThreadContext context,
Block block)
count
public IRubyObject count(ThreadContext context,
IRubyObject obj,
Block block)
nitems
public IRubyObject nitems()
- rb_ary_nitems
op_plus
public IRubyObject op_plus(IRubyObject obj)
- rb_ary_plus
op_times
public IRubyObject op_times(ThreadContext context,
IRubyObject times)
- rb_ary_times
op_times19
public IRubyObject op_times19(ThreadContext context,
IRubyObject times)
- rb_ary_times
uniq_bang
public IRubyObject uniq_bang(ThreadContext context)
- rb_ary_uniq_bang
uniq_bang19
public IRubyObject uniq_bang19(ThreadContext context,
Block block)
uniq
public IRubyObject uniq(ThreadContext context)
- rb_ary_uniq
uniq19
public IRubyObject uniq19(ThreadContext context,
Block block)
op_diff
public IRubyObject op_diff(IRubyObject other)
- rb_ary_diff
op_and
public IRubyObject op_and(IRubyObject other)
- rb_ary_and
op_or
public IRubyObject op_or(IRubyObject other)
- rb_ary_or
sort
public RubyArray sort(ThreadContext context,
Block block)
- rb_ary_sort
sort19
public RubyArray sort19(ThreadContext context,
Block block)
sort_bang
public IRubyObject sort_bang(ThreadContext context,
Block block)
- rb_ary_sort_bang
sort_bang19
public IRubyObject sort_bang19(ThreadContext context,
Block block)
sort_by_bang
public IRubyObject sort_by_bang(ThreadContext context,
Block block)
- rb_ary_sort_by_bang
take
public IRubyObject take(ThreadContext context,
IRubyObject n)
- rb_ary_take
take_while
public IRubyObject take_while(ThreadContext context,
Block block)
- rb_ary_take_while
drop
public IRubyObject drop(ThreadContext context,
IRubyObject n)
- rb_ary_take
drop_while
public IRubyObject drop_while(ThreadContext context,
Block block)
- rb_ary_take_while
cycle
public IRubyObject cycle(ThreadContext context,
Block block)
- rb_ary_cycle
cycle
public IRubyObject cycle(ThreadContext context,
IRubyObject arg,
Block block)
- rb_ary_cycle
product
public IRubyObject product(ThreadContext context,
IRubyObject[] args)
- rb_ary_product
product19
public IRubyObject product19(ThreadContext context,
IRubyObject[] args,
Block block)
combination
public IRubyObject combination(ThreadContext context,
IRubyObject num,
Block block)
- rb_ary_combination
repeatedCombination
public IRubyObject repeatedCombination(ThreadContext context,
IRubyObject num,
Block block)
permutation
public IRubyObject permutation(ThreadContext context,
IRubyObject num,
Block block)
- rb_ary_permutation
permutation
public IRubyObject permutation(ThreadContext context,
Block block)
repeated_permutation
public IRubyObject repeated_permutation(ThreadContext context,
IRubyObject num,
Block block)
repeated_permutation
public IRubyObject repeated_permutation(ThreadContext context,
Block block)
choice
public IRubyObject choice(ThreadContext context)
shuffle_bang
public IRubyObject shuffle_bang(ThreadContext context)
shuffle_bang
public IRubyObject shuffle_bang(ThreadContext context,
IRubyObject[] args)
shuffle
public IRubyObject shuffle(ThreadContext context)
shuffle
public IRubyObject shuffle(ThreadContext context,
IRubyObject[] args)
sample
public IRubyObject sample(ThreadContext context,
IRubyObject[] args)
sample
public IRubyObject sample(ThreadContext context,
IRubyObject nv)
rotate_bang
public IRubyObject rotate_bang(ThreadContext context)
rotate_bang
public IRubyObject rotate_bang(ThreadContext context,
IRubyObject cnt)
rotate
public IRubyObject rotate(ThreadContext context)
rotate
public IRubyObject rotate(ThreadContext context,
IRubyObject cnt)
all_p
public IRubyObject all_p(ThreadContext context,
Block block)
any_p
public IRubyObject any_p(ThreadContext context,
Block block)
find
public IRubyObject find(ThreadContext context,
IRubyObject ifnone,
Block block)
find_index
public IRubyObject find_index(ThreadContext context,
Block block)
find_index
public IRubyObject find_index(ThreadContext context,
IRubyObject cond)
detectCommon
public IRubyObject detectCommon(ThreadContext context,
IRubyObject ifnone,
Block block)
marshalTo
public static void marshalTo(RubyArray array,
MarshalStream output)
throws java.io.IOException
- Throws:
java.io.IOException
unmarshalFrom
public static RubyArray unmarshalFrom(UnmarshalStream input)
throws java.io.IOException
- Throws:
java.io.IOException
try_convert
public static IRubyObject try_convert(ThreadContext context,
IRubyObject self,
IRubyObject arg)
pack
public RubyString pack(ThreadContext context,
IRubyObject obj)
- See Also:
Pack.pack(org.jruby.Ruby, org.jruby.RubyArray, org.jruby.util.ByteList, boolean)
pack19
public RubyString pack19(ThreadContext context,
IRubyObject obj)
getJavaClass
public java.lang.Class getJavaClass()
- Description copied from class:
RubyBasicObject
- Will return the Java interface that most closely can represent
this object, when working through JAva integration
translations.
- Specified by:
getJavaClass
in interface IRubyObject
- Overrides:
getJavaClass
in class RubyBasicObject
- Returns:
- Class
size
public int size()
- Specified by:
size
in interface java.util.Collection
- Specified by:
size
in interface java.util.List
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Collection
- Specified by:
isEmpty
in interface java.util.List
contains
public boolean contains(java.lang.Object element)
- Specified by:
contains
in interface java.util.Collection
- Specified by:
contains
in interface java.util.List
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interface java.util.Collection
- Specified by:
toArray
in interface java.util.List
toArray
public java.lang.Object[] toArray(java.lang.Object[] arg)
- Specified by:
toArray
in interface java.util.Collection
- Specified by:
toArray
in interface java.util.List
toJava
public java.lang.Object toJava(java.lang.Class target)
- Description copied from interface:
IRubyObject
- Convert the object to the specified Java class, if possible.
- Specified by:
toJava
in interface IRubyObject
- Overrides:
toJava
in class RubyBasicObject
- Parameters:
target
- The target type to which the object should be converted.- See Also:
IRubyObject.toJava
add
public boolean add(java.lang.Object element)
- Specified by:
add
in interface java.util.Collection
- Specified by:
add
in interface java.util.List
remove
public boolean remove(java.lang.Object element)
- Specified by:
remove
in interface java.util.Collection
- Specified by:
remove
in interface java.util.List
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAll
in interface java.util.Collection
- Specified by:
containsAll
in interface java.util.List
addAll
public boolean addAll(java.util.Collection c)
- Specified by:
addAll
in interface java.util.Collection
- Specified by:
addAll
in interface java.util.List
addAll
public boolean addAll(int index,
java.util.Collection c)
- Specified by:
addAll
in interface java.util.List
removeAll
public boolean removeAll(java.util.Collection c)
- Specified by:
removeAll
in interface java.util.Collection
- Specified by:
removeAll
in interface java.util.List
retainAll
public boolean retainAll(java.util.Collection c)
- Specified by:
retainAll
in interface java.util.Collection
- Specified by:
retainAll
in interface java.util.List
get
public java.lang.Object get(int index)
- Specified by:
get
in interface java.util.List
set
public java.lang.Object set(int index,
java.lang.Object element)
- Specified by:
set
in interface java.util.List
add
public void add(int index,
java.lang.Object element)
- Specified by:
add
in interface java.util.List
remove
public java.lang.Object remove(int index)
- Specified by:
remove
in interface java.util.List
indexOf
public int indexOf(java.lang.Object element)
- Specified by:
indexOf
in interface java.util.List
lastIndexOf
public int lastIndexOf(java.lang.Object element)
- Specified by:
lastIndexOf
in interface java.util.List
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interface java.lang.Iterable
- Specified by:
iterator
in interface java.util.Collection
- Specified by:
iterator
in interface java.util.List
listIterator
public java.util.ListIterator listIterator()
- Specified by:
listIterator
in interface java.util.List
listIterator
public java.util.ListIterator listIterator(int index)
- Specified by:
listIterator
in interface java.util.List
subList
public java.util.List subList(int fromIndex,
int toIndex)
- Specified by:
subList
in interface java.util.List
clear
public void clear()
- Specified by:
clear
in interface java.util.Collection
- Specified by:
clear
in interface java.util.List
Copyright © 2002-2009 JRuby Team. All Rights Reserved.