Package org.jruby
Class RubyEnumerable
java.lang.Object
org.jruby.RubyEnumerable
The implementation of Ruby's Enumerable module.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
static final class
static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObject
all_p
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
all_p
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
all_p
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
all_pCommon
(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
all_pCommon
(ThreadContext localContext, CallSite each, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
any_p
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
any_p
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
any_p
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
any_pCommon
(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
any_pCommon
(ThreadContext localContext, CallSite site, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
callEach
(ThreadContext context, IRubyObject self, BlockCallback callback) Deprecated.static IRubyObject
callEach
(ThreadContext context, IRubyObject self, IRubyObject[] args, Signature signature, BlockCallback callback) Deprecated.static IRubyObject
callEach
(ThreadContext context, IRubyObject self, Signature signature, BlockCallback callback) static IRubyObject
callEach
(ThreadContext context, CallSite each, IRubyObject self, BlockCallback callback) static IRubyObject
callEach
(ThreadContext context, CallSite each, IRubyObject self, IRubyObject[] args, Signature signature, BlockCallback callback) static IRubyObject
callEach
(ThreadContext context, CallSite each, IRubyObject self, IRubyObject arg0, Signature signature, BlockCallback callback) static IRubyObject
callEach
(ThreadContext context, CallSite each, IRubyObject self, Signature signature, BlockCallback callback) static IRubyObject
chain
(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObject
chunk
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
collect
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
collect_concat
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
compact
(ThreadContext context, IRubyObject self) static IRubyObject
count
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
count
(ThreadContext context, IRubyObject self, IRubyObject methodArg, Block block) static RubyModule
createEnumerableModule
(ThreadContext context) static IRubyObject
cycle
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
cycle
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
detect
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
detect
(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObject
detectCommon
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
detectCommon
(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObject
detectCommon
(ThreadContext context, CallSite each, IRubyObject self, Block block) static IRubyObject
detectCommon
(ThreadContext context, CallSite each, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObject
drop
(ThreadContext context, IRubyObject self, IRubyObject n, Block block) static IRubyObject
drop_while
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
each
(ThreadContext context, IRubyObject self, BlockBody body) Deprecated.static IRubyObject
each
(ThreadContext context, CallSite site, IRubyObject self, BlockBody body) static IRubyObject
each_cons
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
each_entry
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
each_entryCommon
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
each_entryCommon
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObject
each_slice
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
each_with_index
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
each_with_index
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
each_with_index
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObject
each_with_indexCommon
(ThreadContext context, IRubyObject self, Block block, IRubyObject[] args) static IRubyObject
each_with_object
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
each_with_objectCommon
(ThreadContext context, IRubyObject self, Block block, IRubyObject arg) protected static CachingCallSite
eachSite
(ThreadContext context) static IRubyObject
filter_map
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
find
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
find
(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObject
find_all
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
find_index
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
find_index
(ThreadContext context, IRubyObject self, IRubyObject cond, Block block) static IRubyObject
find_indexCommon
(ThreadContext context, IRubyObject self, Block block, Signature callbackArity) static IRubyObject
find_indexCommon
(ThreadContext context, IRubyObject self, IRubyObject cond) static IRubyObject
find_indexCommon
(ThreadContext context, CallSite each, IRubyObject self, Block block, Signature callbackArity) static IRubyObject
find_indexCommon
(ThreadContext context, CallSite each, IRubyObject self, IRubyObject cond) static IRubyObject
first
(ThreadContext context, IRubyObject self) static IRubyObject
first
(ThreadContext context, IRubyObject self, IRubyObject num) static IRubyObject
flat_map
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
grep
(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
group_by
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
include_p
(ThreadContext context, IRubyObject self, IRubyObject arg) static IRubyObject
inject
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
inject
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
inject
(ThreadContext context, IRubyObject self, IRubyObject init, IRubyObject method, Block block) static IRubyObject
injectCommon
(ThreadContext context, IRubyObject self, IRubyObject init, Block block) static IRubyObject
inverseGrep
(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
map
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
max
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
max
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
max_by
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
max_by
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
min
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
min
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
min_by
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
min_by
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
minmax
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
minmax_by
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
none_p
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
none_p
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
none_pCommon
(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
none_pCommon
(ThreadContext context, CallSite each, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
one_p
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
one_p
(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObject
one_pCommon
(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
one_pCommon
(ThreadContext context, CallSite each, IRubyObject self, IRubyObject pattern, Block block) static IRubyObject
partition
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
reject
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
reverse_each
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
reverse_each
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
select
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
selectCommon
(ThreadContext context, IRubyObject self, Block block, String methodName) static IRubyObject
sort
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
sort_by
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
sum
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
sum
(ThreadContext context, IRubyObject self, IRubyObject init, Block block) static IRubyObject
sumAdd
(ThreadContext context, IRubyObject lhs, IRubyObject rhs, SingleDouble c) static IRubyObject
sumCommon
(ThreadContext context, IRubyObject self, IRubyObject init, Block block) static IRubyObject
sumCommon
(ThreadContext context, CallSite each, IRubyObject self, IRubyObject init, Block block) static IRubyObject
take
(ThreadContext context, IRubyObject self, IRubyObject n, Block block) static IRubyObject
take_while
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
takeItems
(ThreadContext context, IRubyObject enumerable) Take all items from the given enumerable and insert them into a new array.static IRubyObject
tally
(ThreadContext context, IRubyObject self) static IRubyObject
tally
(ThreadContext context, IRubyObject self, IRubyObject hashArg) static IRubyObject
to_a
(ThreadContext context, IRubyObject self) static IRubyObject
to_a
(ThreadContext context, IRubyObject self, IRubyObject arg) static IRubyObject
to_a
(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObject
to_h
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
uniq
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
zip
(ThreadContext context, IRubyObject self, Block block) static IRubyObject
zip
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
zip
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObject
zipCommon
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
zipCommon
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, ObjectObjectIntFunction<ThreadContext, IRubyObject, IRubyObject> nextElement) static IRubyObject
zipCommon
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObject
zipCommon
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block, ObjectObjectIntFunction<ThreadContext, IRubyObject, IRubyObject> nextElement) static IRubyObject
zipCommonAry
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
zipCommonAry
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObject
zipCommonEnum
(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObject
zipCommonEnum
(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObject
zipEnumNext
(ThreadContext context, IRubyObject arg)
-
Constructor Details
-
RubyEnumerable
public RubyEnumerable()
-
-
Method Details
-
createEnumerableModule
-
callEach
public static IRubyObject callEach(ThreadContext context, IRubyObject self, Signature signature, BlockCallback callback) -
callEach
public static IRubyObject callEach(ThreadContext context, CallSite each, IRubyObject self, Signature signature, BlockCallback callback) -
callEach
public static IRubyObject callEach(ThreadContext context, CallSite each, IRubyObject self, BlockCallback callback) -
callEach
public static IRubyObject callEach(ThreadContext context, CallSite each, IRubyObject self, IRubyObject[] args, Signature signature, BlockCallback callback) -
callEach
public static IRubyObject callEach(ThreadContext context, CallSite each, IRubyObject self, IRubyObject arg0, Signature signature, BlockCallback callback) -
each
public static IRubyObject each(ThreadContext context, CallSite site, IRubyObject self, BlockBody body) -
count
-
count
public static IRubyObject count(ThreadContext context, IRubyObject self, IRubyObject methodArg, Block block) -
cycle
-
cycle
public static IRubyObject cycle(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
take
-
take_while
-
drop
-
drop_while
-
first
-
first
-
tally
-
tally
-
to_a
-
to_a
-
to_a
-
to_h
public static IRubyObject to_h(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
sort
-
sort_by
-
grep
public static IRubyObject grep(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) -
inverseGrep
public static IRubyObject inverseGrep(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) -
detectCommon
-
detectCommon
public static IRubyObject detectCommon(ThreadContext context, CallSite each, IRubyObject self, Block block) -
detectCommon
public static IRubyObject detectCommon(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) -
detectCommon
public static IRubyObject detectCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject ifnone, Block block) -
detect
-
detect
public static IRubyObject detect(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) -
find
-
find
public static IRubyObject find(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) -
find_index
-
find_index
public static IRubyObject find_index(ThreadContext context, IRubyObject self, IRubyObject cond, Block block) -
find_indexCommon
public static IRubyObject find_indexCommon(ThreadContext context, IRubyObject self, Block block, Signature callbackArity) -
find_indexCommon
public static IRubyObject find_indexCommon(ThreadContext context, CallSite each, IRubyObject self, Block block, Signature callbackArity) -
find_indexCommon
public static IRubyObject find_indexCommon(ThreadContext context, IRubyObject self, IRubyObject cond) -
find_indexCommon
public static IRubyObject find_indexCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject cond) -
selectCommon
public static IRubyObject selectCommon(ThreadContext context, IRubyObject self, Block block, String methodName) -
select
-
find_all
-
reject
-
collect
-
map
-
filter_map
-
flat_map
-
collect_concat
-
sum
-
sum
public static IRubyObject sum(ThreadContext context, IRubyObject self, IRubyObject init, Block block) -
sumCommon
public static IRubyObject sumCommon(ThreadContext context, IRubyObject self, IRubyObject init, Block block) -
sumCommon
public static IRubyObject sumCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject init, Block block) -
sumAdd
public static IRubyObject sumAdd(ThreadContext context, IRubyObject lhs, IRubyObject rhs, SingleDouble c) -
injectCommon
public static IRubyObject injectCommon(ThreadContext context, IRubyObject self, IRubyObject init, Block block) -
inject
-
inject
public static IRubyObject inject(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
inject
public static IRubyObject inject(ThreadContext context, IRubyObject self, IRubyObject init, IRubyObject method, Block block) -
partition
-
each_with_indexCommon
public static IRubyObject each_with_indexCommon(ThreadContext context, IRubyObject self, Block block, IRubyObject[] args) -
each_with_objectCommon
public static IRubyObject each_with_objectCommon(ThreadContext context, IRubyObject self, Block block, IRubyObject arg) -
each_with_index
-
each_with_index
public static IRubyObject each_with_index(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) -
each_with_index
public static IRubyObject each_with_index(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
each_with_object
public static IRubyObject each_with_object(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
each_entry
public static IRubyObject each_entry(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
each_entryCommon
public static IRubyObject each_entryCommon(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) -
each_entryCommon
public static IRubyObject each_entryCommon(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
each_slice
public static IRubyObject each_slice(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
each_cons
public static IRubyObject each_cons(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
reverse_each
-
reverse_each
public static IRubyObject reverse_each(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
include_p
-
max
-
max
public static IRubyObject max(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
min
-
min
public static IRubyObject min(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
max_by
-
max_by
public static IRubyObject max_by(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
min_by
-
min_by
public static IRubyObject min_by(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
minmax
-
minmax_by
-
none_p
-
none_p
public static IRubyObject none_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
none_pCommon
public static IRubyObject none_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) -
none_pCommon
public static IRubyObject none_pCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject pattern, Block block) -
one_p
-
one_p
public static IRubyObject one_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
one_pCommon
public static IRubyObject one_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) -
one_pCommon
public static IRubyObject one_pCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject pattern, Block block) -
all_p
-
all_p
public static IRubyObject all_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
all_p
public static IRubyObject all_p(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
all_pCommon
public static IRubyObject all_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) -
all_pCommon
public static IRubyObject all_pCommon(ThreadContext localContext, CallSite each, IRubyObject self, IRubyObject pattern, Block block) -
any_p
-
any_p
public static IRubyObject any_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) -
any_p
public static IRubyObject any_p(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
any_pCommon
public static IRubyObject any_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) -
any_pCommon
public static IRubyObject any_pCommon(ThreadContext localContext, CallSite site, IRubyObject self, IRubyObject pattern, Block block) -
zip
-
zip
public static IRubyObject zip(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) -
zip
public static IRubyObject zip(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
zipCommon
public static IRubyObject zipCommon(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) -
zipCommon
public static IRubyObject zipCommon(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
zipCommonAry
public static IRubyObject zipCommonAry(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
zipCommonAry
public static IRubyObject zipCommonAry(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) -
zipCommonEnum
public static IRubyObject zipCommonEnum(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) -
zipCommonEnum
public static IRubyObject zipCommonEnum(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) -
zipCommon
public static IRubyObject zipCommon(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, ObjectObjectIntFunction<ThreadContext, IRubyObject, IRubyObject> nextElement) -
zipCommon
public static IRubyObject zipCommon(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block, ObjectObjectIntFunction<ThreadContext, IRubyObject, IRubyObject> nextElement) -
takeItems
Take all items from the given enumerable and insert them into a new array. See take_items() in array.c.- Parameters:
context
- current contextenumerable
- object from which to take- Returns:
- an array of the object's elements
-
zipEnumNext
-
group_by
-
chain
-
chunk
-
uniq
-
compact
-
callEach
@Deprecated public static IRubyObject callEach(ThreadContext context, IRubyObject self, IRubyObject[] args, Signature signature, BlockCallback callback) Deprecated. -
callEach
@Deprecated public static IRubyObject callEach(ThreadContext context, IRubyObject self, BlockCallback callback) Deprecated. -
each
Deprecated. -
eachSite
-