|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyObject
org.jruby.RubyArray
public class RubyArray
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.
Nested Class Summary | |
---|---|
class |
RubyArray.RubyArrayConversionIterator
|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Finalizer, RubyObject.ObjectMethods, RubyObject.VariableTableEntry |
Field Summary | |
---|---|
static int |
ARRAY_DEFAULT_SIZE
|
Fields inherited from class org.jruby.RubyObject |
---|
ALL_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, OBJECT_ALLOCATOR, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, VARIABLE_TABLE_DEFAULT_CAPACITY, VARIABLE_TABLE_EMPTY_TABLE, VARIABLE_TABLE_LOAD_FACTOR, VARIABLE_TABLE_MAXIMUM_CAPACITY, variableTable, variableTableSize, variableTableThreshold |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
RubyArray(Ruby runtime,
long length,
IRubyObject[] vals)
|
|
RubyArray(Ruby runtime,
RubyClass klass)
|
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)
|
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)
rb_ary_aref |
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)
rb_ary_aset |
IRubyObject |
aset(IRubyObject arg0,
IRubyObject arg1,
IRubyObject arg2)
rb_ary_aset |
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". |
void |
clear()
|
RubyArray |
collect_bang(ThreadContext context,
Block block)
rb_ary_collect_bang |
RubyArray |
collect(ThreadContext context,
Block block)
rb_ary_collect |
IRubyObject |
compact_bang()
rb_ary_compact_bang |
IRubyObject |
compact()
rb_ary_compact |
RubyArray |
concat(IRubyObject obj)
rb_ary_concat |
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. |
static IRubyObject |
create(IRubyObject klass,
IRubyObject[] args,
Block block)
rb_ary_s_create |
static RubyClass |
createArrayClass(Ruby runtime)
|
IRubyObject |
delete_at(IRubyObject obj)
rb_ary_delete_at_m |
IRubyObject |
delete_if(ThreadContext context,
Block block)
rb_ary_delete_if |
IRubyObject |
delete(ThreadContext context,
IRubyObject item,
Block block)
rb_ary_delete |
IRubyObject |
each_index(ThreadContext context,
Block block)
rb_ary_each_index |
IRubyObject |
each(ThreadContext context,
Block block)
rb_ary_each |
IRubyObject |
eltInternal(int offset)
|
IRubyObject |
eltInternalSet(int offset,
IRubyObject item)
|
IRubyObject |
empty_p()
rb_ary_empty_p |
IRubyObject |
entry(int offset)
rb_ary_entry |
IRubyObject |
entry(long offset)
rb_ary_entry |
RubyBoolean |
eql_p(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,
IRubyObject[] args,
Block block)
rb_ary_fill |
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)
rb_ary_flatten_bang |
IRubyObject |
flatten(ThreadContext context)
rb_ary_flatten |
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. |
RubyFixnum |
hash(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,
IRubyObject obj)
rb_ary_index |
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,
IRubyObject[] args,
Block block)
rb_ary_initialize |
IRubyObject |
insert(IRubyObject arg)
rb_ary_insert |
IRubyObject |
insert(IRubyObject[] args)
rb_ary_insert |
IRubyObject |
insert(IRubyObject arg1,
IRubyObject arg2)
rb_ary_insert |
IRubyObject |
inspect()
rb_ary_inspect |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
RubyString |
join_m(ThreadContext context,
IRubyObject[] args)
rb_ary_join_m |
RubyString |
join(ThreadContext context,
IRubyObject sep)
rb_ary_join |
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)
|
static void |
marshalTo(RubyArray array,
MarshalStream output)
|
static RubyArray |
newArray(Ruby runtime)
rb_ary_new |
static RubyArray |
newArray(Ruby runtime,
java.util.Collection collection)
|
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,
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 |
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 |
RubyString |
pack(ThreadContext context,
IRubyObject obj)
|
IRubyObject |
pop()
rb_ary_pop |
RubyArray |
push_m(IRubyObject[] items)
rb_ary_push_m FIXME: Whis is this named "push_m"? |
IRubyObject |
rassoc(ThreadContext context,
IRubyObject value)
rb_ary_rassoc |
IRubyObject |
rb_clear()
rb_ary_clear |
IRubyObject |
reject_bang(ThreadContext context,
Block block)
rb_ary_reject_bang |
IRubyObject |
reject(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 |
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)
rb_ary_reverse_each |
IRubyObject |
reverse()
rb_ary_reverse_m |
IRubyObject |
rindex(ThreadContext context,
IRubyObject obj)
rb_ary_rindex |
RubyArray |
select(ThreadContext context,
Block block)
rb_ary_select |
java.lang.Object |
set(int index,
java.lang.Object element)
|
IRubyObject |
shift()
rb_ary_shift |
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 |
RubyArray |
sort_bang(Block block)
rb_ary_sort_bang |
RubyArray |
sort(Block block)
rb_ary_sort |
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 |
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)
|
IRubyObject[] |
toJavaArray()
|
IRubyObject[] |
toJavaArrayMaybeUnsafe()
|
IRubyObject[] |
toJavaArrayUnsafe()
|
RubyArray |
transpose()
rb_ary_transpose |
IRubyObject |
uniq_bang()
rb_ary_uniq_bang |
IRubyObject |
uniq()
rb_ary_uniq |
static RubyArray |
unmarshalFrom(UnmarshalStream input)
|
RubyArray |
unshift_m(IRubyObject[] items)
rb_ary_unshift_m |
RubyArray |
unshift(IRubyObject item)
rb_ary_unshift |
IRubyObject |
values_at(IRubyObject[] args)
rb_values_at |
IRubyObject |
zip(ThreadContext context,
IRubyObject[] args,
Block block)
rb_ary_zip |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
equals, hashCode |
Field Detail |
---|
public static final int ARRAY_DEFAULT_SIZE
Constructor Detail |
---|
public RubyArray(Ruby runtime, long length, IRubyObject[] vals)
public RubyArray(Ruby runtime, RubyClass klass)
Method Detail |
---|
public static RubyClass createArrayClass(Ruby runtime)
public int getNativeTypeIndex()
RubyObject
getNativeTypeIndex
in interface CoreObjectType
getNativeTypeIndex
in class RubyObject
org.jruby.runtime.ClassInde
public static IRubyObject create(IRubyObject klass, IRubyObject[] args, Block block)
public static final RubyArray newArray(Ruby runtime, long len)
public static final RubyArray newArrayLight(Ruby runtime, long len)
public static final RubyArray newArray(Ruby runtime)
public static final RubyArray newArrayLight(Ruby runtime)
public static RubyArray newArray(Ruby runtime, IRubyObject obj)
public static RubyArray newArrayLight(Ruby runtime, IRubyObject obj)
public static RubyArray newArray(Ruby runtime, IRubyObject car, IRubyObject cdr)
public static RubyArray newEmptyArray(Ruby runtime)
public static RubyArray newArray(Ruby runtime, IRubyObject[] args)
public static RubyArray newArrayNoCopy(Ruby runtime, IRubyObject[] args)
public static RubyArray newArrayNoCopy(Ruby runtime, IRubyObject[] args, int begin)
public static RubyArray newArrayNoCopyLight(Ruby runtime, IRubyObject[] args)
public static RubyArray newArray(Ruby runtime, java.util.Collection collection)
public java.util.List getList()
public int getLength()
public IRubyObject[] toJavaArray()
public IRubyObject[] toJavaArrayUnsafe()
public IRubyObject[] toJavaArrayMaybeUnsafe()
public IRubyObject initialize(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject initialize_copy(IRubyObject orig)
initialize_copy
in class RubyObject
public IRubyObject replace(IRubyObject orig)
public IRubyObject to_s()
to_s
in class RubyObject
public boolean includes(ThreadContext context, IRubyObject item)
public RubyFixnum hash(ThreadContext context)
public final IRubyObject store(long index, IRubyObject value)
public final IRubyObject entry(long offset)
public final IRubyObject entry(int offset)
public final IRubyObject eltInternal(int offset)
public final IRubyObject eltInternalSet(int offset, IRubyObject item)
public IRubyObject fetch(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject fetch(ThreadContext context, IRubyObject arg0, Block block)
public IRubyObject fetch(ThreadContext context, IRubyObject arg0, IRubyObject arg1, Block block)
public IRubyObject insert(IRubyObject arg)
public IRubyObject insert(IRubyObject arg1, IRubyObject arg2)
public IRubyObject insert(IRubyObject[] args)
public final RubyArray aryDup()
public RubyArray transpose()
public IRubyObject values_at(IRubyObject[] args)
public IRubyObject subseq(long beg, long len)
public IRubyObject subseqLight(long beg, long len)
public RubyFixnum length()
public RubyArray append(IRubyObject item)
public RubyArray push_m(IRubyObject[] items)
public IRubyObject pop()
public IRubyObject shift()
public RubyArray unshift(IRubyObject item)
public RubyArray unshift_m(IRubyObject[] items)
public RubyBoolean include_p(ThreadContext context, IRubyObject item)
public RubyBoolean frozen_p(ThreadContext context)
frozen_p
in class RubyObject
public IRubyObject aref(IRubyObject[] args)
public IRubyObject aref(IRubyObject arg0)
public IRubyObject aref(IRubyObject arg0, IRubyObject arg1)
public IRubyObject aset(IRubyObject[] args)
public IRubyObject aset(IRubyObject arg0, IRubyObject arg1)
public IRubyObject aset(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2)
public IRubyObject at(IRubyObject pos)
public RubyArray concat(IRubyObject obj)
public IRubyObject inspect()
inspect
in interface IRubyObject
inspect
in class RubyObject
public IRubyObject first(IRubyObject[] args)
public IRubyObject first()
public IRubyObject first(IRubyObject arg0)
public IRubyObject last(IRubyObject[] args)
public IRubyObject last()
public IRubyObject last(IRubyObject arg0)
public IRubyObject each(ThreadContext context, Block block)
public IRubyObject each_index(ThreadContext context, Block block)
public IRubyObject reverse_each(ThreadContext context, Block block)
public RubyString join(ThreadContext context, IRubyObject sep)
public RubyString join_m(ThreadContext context, IRubyObject[] args)
public RubyArray to_a()
to_a
in class RubyObject
public IRubyObject to_ary()
public RubyArray convertToArray()
RubyObject
convertToArray
in interface IRubyObject
convertToArray
in class RubyObject
public IRubyObject checkArrayType()
RubyObject
checkArrayType
in interface IRubyObject
checkArrayType
in class RubyObject
public IRubyObject op_equal(ThreadContext context, IRubyObject obj)
op_equal
in interface IRubyObject
op_equal
in class RubyObject
public RubyBoolean eql_p(ThreadContext context, IRubyObject obj)
public IRubyObject compact_bang()
public IRubyObject compact()
public IRubyObject empty_p()
public IRubyObject rb_clear()
public IRubyObject fill(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject index(ThreadContext context, IRubyObject obj)
public IRubyObject rindex(ThreadContext context, IRubyObject obj)
public IRubyObject indexes(IRubyObject[] args)
public IRubyObject reverse_bang()
public IRubyObject reverse()
public RubyArray collect(ThreadContext context, Block block)
public RubyArray collect_bang(ThreadContext context, Block block)
public RubyArray select(ThreadContext context, Block block)
public IRubyObject delete(ThreadContext context, IRubyObject item, Block block)
public IRubyObject delete_at(IRubyObject obj)
public IRubyObject reject(ThreadContext context, Block block)
public IRubyObject reject_bang(ThreadContext context, Block block)
public IRubyObject delete_if(ThreadContext context, Block block)
public IRubyObject zip(ThreadContext context, IRubyObject[] args, Block block)
public IRubyObject op_cmp(ThreadContext context, IRubyObject obj)
public IRubyObject slice_bang(IRubyObject[] args)
public IRubyObject slice_bang(IRubyObject arg0)
public IRubyObject slice_bang(IRubyObject arg0, IRubyObject arg1)
public IRubyObject assoc(ThreadContext context, IRubyObject key)
public IRubyObject rassoc(ThreadContext context, IRubyObject value)
public IRubyObject flatten_bang(ThreadContext context)
public IRubyObject flatten(ThreadContext context)
public IRubyObject nitems()
public IRubyObject op_plus(IRubyObject obj)
public IRubyObject op_times(ThreadContext context, IRubyObject times)
public IRubyObject uniq_bang()
public IRubyObject uniq()
public IRubyObject op_diff(IRubyObject other)
public IRubyObject op_and(IRubyObject other)
public IRubyObject op_or(IRubyObject other)
public RubyArray sort(Block block)
public RubyArray sort_bang(Block block)
public static void marshalTo(RubyArray array, MarshalStream output) throws java.io.IOException
java.io.IOException
public static RubyArray unmarshalFrom(UnmarshalStream input) throws java.io.IOException
java.io.IOException
public RubyString pack(ThreadContext context, IRubyObject obj)
Pack.pack(org.jruby.Ruby, org.jruby.RubyArray, ByteList)
public java.lang.Class getJavaClass()
RubyObject
getJavaClass
in interface IRubyObject
getJavaClass
in class RubyObject
public int size()
size
in interface java.util.Collection
size
in interface java.util.List
public boolean isEmpty()
isEmpty
in interface java.util.Collection
isEmpty
in interface java.util.List
public boolean contains(java.lang.Object element)
contains
in interface java.util.Collection
contains
in interface java.util.List
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public java.lang.Object[] toArray(java.lang.Object[] arg)
toArray
in interface java.util.Collection
toArray
in interface java.util.List
public boolean add(java.lang.Object element)
add
in interface java.util.Collection
add
in interface java.util.List
public boolean remove(java.lang.Object element)
remove
in interface java.util.Collection
remove
in interface java.util.List
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
containsAll
in interface java.util.List
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
public java.lang.Object get(int index)
get
in interface java.util.List
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
public void add(int index, java.lang.Object element)
add
in interface java.util.List
public java.lang.Object remove(int index)
remove
in interface java.util.List
public int indexOf(java.lang.Object element)
indexOf
in interface java.util.List
public int lastIndexOf(java.lang.Object element)
lastIndexOf
in interface java.util.List
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
iterator
in interface java.util.List
public java.util.ListIterator listIterator()
listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int index)
listIterator
in interface java.util.List
public java.util.List subList(int fromIndex, int toIndex)
subList
in interface java.util.List
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |