|
||||||||||
| 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.
| Nested Class Summary | |
|---|---|
class |
RubyArray.RubyArrayConversionIterator
|
| Nested classes/interfaces inherited from class org.jruby.RubyObject |
|---|
RubyObject.Finalizer |
| Field Summary | |
|---|---|
static byte |
AREF_SWITCHVALUE
|
static int |
ARRAY_DEFAULT_SIZE
|
static byte |
ASET_SWITCHVALUE
|
static byte |
AT_SWITCHVALUE
|
static byte |
EMPTY_P_SWITCHVALUE
|
static byte |
EQUALEQUAL_SWITCHVALUE
|
static byte |
HASH_SWITCHVALUE
|
static byte |
INSPECT_SWITCHVALUE
|
static byte |
LAST_SWITCHVALUE
|
static byte |
LENGTH_SWITCHVALUE
|
static byte |
NIL_P_SWITCHVALUE
|
static byte |
OP_LSHIFT_SWITCHVALUE
|
static byte |
OP_PLUS_SWITCHVALUE
|
static byte |
OP_SPACESHIP_SWITCHVALUE
|
static byte |
OP_TIMES_SWITCHVALUE
|
static byte |
POP_SWITCHVALUE
|
static byte |
PUSH_SWITCHVALUE
|
static byte |
SHIFT_SWITCHVALUE
|
static byte |
TO_A_SWITCHVALUE
|
static byte |
TO_ARY_SWITCHVALUE
|
static byte |
TO_S_SWITCHVALUE
|
static byte |
UNSHIFT_SWITCHVALUE
|
| Fields inherited from class org.jruby.RubyObject |
|---|
instanceVariables, isTrue, metaClass, NEVER, OBJECT_ALLOCATOR |
| 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[] args)
rb_ary_aref |
IRubyObject |
aset(IRubyObject[] args)
rb_ary_aset |
IRubyObject |
assoc(IRubyObject key)
rb_ary_assoc |
IRubyObject |
at(IRubyObject pos)
rb_ary_at |
IRubyObject |
callMethod(ThreadContext context,
RubyModule rubyclass,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
|
IRubyObject |
checkArrayType()
rb_check_array_type |
void |
clear()
|
RubyArray |
collect_bang(Block block)
rb_ary_collect_bang |
RubyArray |
collect(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()
Methods which perform to_xxx if the object has such a 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(Block block)
rb_ary_delete_if |
IRubyObject |
delete(IRubyObject item,
Block block)
rb_ary_delete |
IRubyObject |
each_index(Block block)
rb_ary_each_index |
IRubyObject |
each(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(IRubyObject obj)
rb_ary_eql |
IRubyObject |
fetch(IRubyObject[] args,
Block block)
rb_ary_fetch |
IRubyObject |
fill(IRubyObject[] args,
Block block)
rb_ary_fill |
IRubyObject |
first(IRubyObject[] args)
rb_ary_first |
IRubyObject |
flatten_bang()
rb_ary_flatten_bang |
IRubyObject |
flatten()
rb_ary_flatten |
RubyBoolean |
frozen()
rb_ary_frozen_p |
java.lang.Object |
get(int index)
|
java.lang.Class |
getJavaClass()
RubyMethod getJavaClass. |
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()
rb_ary_hash |
RubyBoolean |
include_p(IRubyObject item)
rb_ary_includes |
boolean |
includes(IRubyObject item)
|
IRubyObject |
index(IRubyObject obj)
rb_ary_index |
IRubyObject |
indexes(IRubyObject[] args)
rb_ary_indexes |
int |
indexOf(java.lang.Object element)
|
IRubyObject |
initialize(IRubyObject[] args,
Block block)
rb_ary_initialize |
IRubyObject |
insert(IRubyObject[] args)
rb_ary_insert |
IRubyObject |
inspect()
rb_ary_inspect |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
RubyString |
join_m(IRubyObject[] args)
rb_ary_join_m |
RubyString |
join(IRubyObject sep)
rb_ary_join |
IRubyObject |
last(IRubyObject[] args)
rb_ary_last |
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,
long len)
|
static RubyArray |
newArrayNoCopy(Ruby runtime,
IRubyObject[] args)
|
static RubyArray |
newArrayNoCopyLight(Ruby runtime,
IRubyObject[] args)
|
IRubyObject |
nitems()
rb_ary_nitems |
IRubyObject |
op_and(IRubyObject other)
rb_ary_and |
IRubyObject |
op_cmp(IRubyObject obj)
rb_ary_cmp |
IRubyObject |
op_diff(IRubyObject other)
rb_ary_diff |
IRubyObject |
op_equal(IRubyObject obj)
rb_ary_equal |
IRubyObject |
op_or(IRubyObject other)
rb_ary_or |
IRubyObject |
op_plus(IRubyObject obj)
rb_ary_plus |
IRubyObject |
op_times(IRubyObject times)
rb_ary_times |
RubyString |
pack(IRubyObject obj)
|
IRubyObject |
pop()
rb_ary_pop |
RubyArray |
push_m(IRubyObject[] items)
rb_ary_push_m |
IRubyObject |
rassoc(IRubyObject value)
rb_ary_rassoc |
IRubyObject |
rb_clear()
rb_ary_clear |
IRubyObject |
reject_bang(Block block)
rb_ary_reject_bang |
IRubyObject |
reject(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(Block block)
rb_ary_reverse_each |
IRubyObject |
reverse()
rb_ary_reverse_m |
IRubyObject |
rindex(IRubyObject obj)
rb_ary_rindex |
RubyArray |
select(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[] args)
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(IRubyObject[] args,
Block block)
rb_ary_zip |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
equals, hashCode |
| Field Detail |
|---|
public static final byte OP_PLUS_SWITCHVALUE
public static final byte AREF_SWITCHVALUE
public static final byte ASET_SWITCHVALUE
public static final byte POP_SWITCHVALUE
public static final byte PUSH_SWITCHVALUE
public static final byte NIL_P_SWITCHVALUE
public static final byte EQUALEQUAL_SWITCHVALUE
public static final byte UNSHIFT_SWITCHVALUE
public static final byte OP_LSHIFT_SWITCHVALUE
public static final byte EMPTY_P_SWITCHVALUE
public static final byte TO_S_SWITCHVALUE
public static final byte AT_SWITCHVALUE
public static final byte TO_ARY_SWITCHVALUE
public static final byte TO_A_SWITCHVALUE
public static final byte HASH_SWITCHVALUE
public static final byte OP_TIMES_SWITCHVALUE
public static final byte OP_SPACESHIP_SWITCHVALUE
public static final byte LENGTH_SWITCHVALUE
public static final byte LAST_SWITCHVALUE
public static final byte SHIFT_SWITCHVALUE
public static final byte INSPECT_SWITCHVALUE
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 IRubyObject callMethod(ThreadContext context,
RubyModule rubyclass,
int methodIndex,
java.lang.String name,
IRubyObject[] args,
CallType callType,
Block block)
callMethod in interface IRubyObjectcallMethod in class RubyObjectpublic int getNativeTypeIndex()
RubyObject
getNativeTypeIndex in interface IRubyObjectgetNativeTypeIndex in class RubyObject
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 newArray(Ruby runtime,
IRubyObject car,
IRubyObject cdr)
public static RubyArray newArray(Ruby runtime,
IRubyObject[] args)
public static RubyArray newArrayNoCopy(Ruby runtime,
IRubyObject[] args)
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(IRubyObject[] args,
Block block)
initialize in class RubyObjectpublic IRubyObject replace(IRubyObject orig)
public IRubyObject to_s()
to_s in class RubyObjectpublic boolean includes(IRubyObject item)
public RubyFixnum hash()
hash in class RubyObject
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(IRubyObject[] args,
Block block)
public IRubyObject insert(IRubyObject[] args)
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(IRubyObject item)
public RubyBoolean frozen()
frozen in class RubyObjectpublic IRubyObject aref(IRubyObject[] args)
public IRubyObject aset(IRubyObject[] args)
public IRubyObject at(IRubyObject pos)
public RubyArray concat(IRubyObject obj)
public IRubyObject inspect()
inspect in interface IRubyObjectinspect in class RubyObjectpublic IRubyObject first(IRubyObject[] args)
public IRubyObject last(IRubyObject[] args)
public IRubyObject each(Block block)
public IRubyObject each_index(Block block)
public IRubyObject reverse_each(Block block)
public RubyString join(IRubyObject sep)
public RubyString join_m(IRubyObject[] args)
public RubyArray to_a()
public IRubyObject to_ary()
public RubyArray convertToArray()
IRubyObject
convertToArray in interface IRubyObjectconvertToArray in class RubyObjectpublic IRubyObject checkArrayType()
RubyObject
checkArrayType in interface IRubyObjectcheckArrayType in class RubyObjectpublic IRubyObject op_equal(IRubyObject obj)
public RubyBoolean eql_p(IRubyObject obj)
public IRubyObject compact_bang()
public IRubyObject compact()
public IRubyObject empty_p()
public IRubyObject rb_clear()
public IRubyObject fill(IRubyObject[] args,
Block block)
public IRubyObject index(IRubyObject obj)
public IRubyObject rindex(IRubyObject obj)
public IRubyObject indexes(IRubyObject[] args)
public IRubyObject reverse_bang()
public IRubyObject reverse()
public RubyArray collect(Block block)
public RubyArray collect_bang(Block block)
public RubyArray select(Block block)
public IRubyObject delete(IRubyObject item,
Block block)
public IRubyObject delete_at(IRubyObject obj)
public IRubyObject reject(Block block)
public IRubyObject reject_bang(Block block)
public IRubyObject delete_if(Block block)
public IRubyObject zip(IRubyObject[] args,
Block block)
public IRubyObject op_cmp(IRubyObject obj)
public IRubyObject slice_bang(IRubyObject[] args)
public IRubyObject assoc(IRubyObject key)
public IRubyObject rassoc(IRubyObject value)
public IRubyObject flatten_bang()
public IRubyObject flatten()
public IRubyObject nitems()
public IRubyObject op_plus(IRubyObject obj)
public IRubyObject op_times(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.IOExceptionpublic RubyString pack(IRubyObject obj)
Pack.pack(org.jruby.Ruby, org.jruby.RubyArray, org.jruby.util.ByteList)public java.lang.Class getJavaClass()
IRubyObject
getJavaClass in interface IRubyObjectgetJavaClass in class RubyObjectpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Listpublic boolean contains(java.lang.Object element)
contains in interface java.util.Collectioncontains in interface java.util.Listpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic java.lang.Object[] toArray(java.lang.Object[] arg)
toArray in interface java.util.CollectiontoArray in interface java.util.Listpublic boolean add(java.lang.Object element)
add in interface java.util.Collectionadd in interface java.util.Listpublic boolean remove(java.lang.Object element)
remove in interface java.util.Collectionremove in interface java.util.Listpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Listpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.List
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.Listpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Listpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.Listpublic 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.Listpublic java.lang.Object remove(int index)
remove in interface java.util.Listpublic int indexOf(java.lang.Object element)
indexOf in interface java.util.Listpublic int lastIndexOf(java.lang.Object element)
lastIndexOf in interface java.util.Listpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listpublic java.util.ListIterator listIterator()
listIterator in interface java.util.Listpublic 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.Listpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.List
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||