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 classstatic final classstatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObjectall_p(ThreadContext context, IRubyObject self, Block block) static IRubyObjectall_p(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectall_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectall_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectall_pCommon(ThreadContext localContext, CallSite each, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectany_p(ThreadContext context, IRubyObject self, Block block) static IRubyObjectany_p(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectany_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectany_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectany_pCommon(ThreadContext localContext, CallSite site, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectcallEach(ThreadContext context, IRubyObject self, BlockCallback callback) Deprecated.static IRubyObjectcallEach(ThreadContext context, IRubyObject self, IRubyObject[] args, Signature signature, BlockCallback callback) Deprecated.static IRubyObjectcallEach(ThreadContext context, IRubyObject self, Signature signature, BlockCallback callback) static IRubyObjectcallEach(ThreadContext context, CallSite each, IRubyObject self, BlockCallback callback) static IRubyObjectcallEach(ThreadContext context, CallSite each, IRubyObject self, IRubyObject[] args, Signature signature, BlockCallback callback) static IRubyObjectcallEach(ThreadContext context, CallSite each, IRubyObject self, IRubyObject arg0, Signature signature, BlockCallback callback) static IRubyObjectcallEach(ThreadContext context, CallSite each, IRubyObject self, Signature signature, BlockCallback callback) static IRubyObjectchain(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObjectchunk(ThreadContext context, IRubyObject self, Block block) static IRubyObjectcollect(ThreadContext context, IRubyObject self, Block block) static IRubyObjectcollect_concat(ThreadContext context, IRubyObject self, Block block) static IRubyObjectcompact(ThreadContext context, IRubyObject self) static IRubyObjectcount(ThreadContext context, IRubyObject self, Block block) static IRubyObjectcount(ThreadContext context, IRubyObject self, IRubyObject methodArg, Block block) static RubyModulecreateEnumerableModule(ThreadContext context) static IRubyObjectcycle(ThreadContext context, IRubyObject self, Block block) static IRubyObjectcycle(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectdetect(ThreadContext context, IRubyObject self, Block block) static IRubyObjectdetect(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObjectdetectCommon(ThreadContext context, IRubyObject self, Block block) static IRubyObjectdetectCommon(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObjectdetectCommon(ThreadContext context, CallSite each, IRubyObject self, Block block) static IRubyObjectdetectCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObjectdrop(ThreadContext context, IRubyObject self, IRubyObject n, Block block) static IRubyObjectdrop_while(ThreadContext context, IRubyObject self, Block block) static IRubyObjecteach(ThreadContext context, IRubyObject self, BlockBody body) Deprecated.static IRubyObjecteach(ThreadContext context, CallSite site, IRubyObject self, BlockBody body) static IRubyObjecteach_cons(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjecteach_entry(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjecteach_entryCommon(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjecteach_entryCommon(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObjecteach_slice(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjecteach_with_index(ThreadContext context, IRubyObject self, Block block) static IRubyObjecteach_with_index(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjecteach_with_index(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObjecteach_with_indexCommon(ThreadContext context, IRubyObject self, Block block, IRubyObject[] args) static IRubyObjecteach_with_object(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjecteach_with_objectCommon(ThreadContext context, IRubyObject self, Block block, IRubyObject arg) protected static CachingCallSiteeachSite(ThreadContext context) static IRubyObjectfilter_map(ThreadContext context, IRubyObject self, Block block) static IRubyObjectfind(ThreadContext context, IRubyObject self, Block block) static IRubyObjectfind(ThreadContext context, IRubyObject self, IRubyObject ifnone, Block block) static IRubyObjectfind_all(ThreadContext context, IRubyObject self, Block block) static IRubyObjectfind_index(ThreadContext context, IRubyObject self, Block block) static IRubyObjectfind_index(ThreadContext context, IRubyObject self, IRubyObject cond, Block block) static IRubyObjectfind_indexCommon(ThreadContext context, IRubyObject self, Block block, Signature callbackArity) static IRubyObjectfind_indexCommon(ThreadContext context, IRubyObject self, IRubyObject cond) static IRubyObjectfind_indexCommon(ThreadContext context, CallSite each, IRubyObject self, Block block, Signature callbackArity) static IRubyObjectfind_indexCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject cond) static IRubyObjectfirst(ThreadContext context, IRubyObject self) static IRubyObjectfirst(ThreadContext context, IRubyObject self, IRubyObject num) static IRubyObjectflat_map(ThreadContext context, IRubyObject self, Block block) static IRubyObjectgrep(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectgroup_by(ThreadContext context, IRubyObject self, Block block) static IRubyObjectinclude_p(ThreadContext context, IRubyObject self, IRubyObject arg) static IRubyObjectinject(ThreadContext context, IRubyObject self, Block block) static IRubyObjectinject(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectinject(ThreadContext context, IRubyObject self, IRubyObject init, IRubyObject method, Block block) static IRubyObjectinjectCommon(ThreadContext context, IRubyObject self, IRubyObject init, Block block) static IRubyObjectinverseGrep(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectmap(ThreadContext context, IRubyObject self, Block block) static IRubyObjectmax(ThreadContext context, IRubyObject self, Block block) static IRubyObjectmax(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectmax_by(ThreadContext context, IRubyObject self, Block block) static IRubyObjectmax_by(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectmin(ThreadContext context, IRubyObject self, Block block) static IRubyObjectmin(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectmin_by(ThreadContext context, IRubyObject self, Block block) static IRubyObjectmin_by(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectminmax(ThreadContext context, IRubyObject self, Block block) static IRubyObjectminmax_by(ThreadContext context, IRubyObject self, Block block) static IRubyObjectnone_p(ThreadContext context, IRubyObject self, Block block) static IRubyObjectnone_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectnone_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectnone_pCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectone_p(ThreadContext context, IRubyObject self, Block block) static IRubyObjectone_p(ThreadContext context, IRubyObject self, IRubyObject arg, Block block) static IRubyObjectone_pCommon(ThreadContext context, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectone_pCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject pattern, Block block) static IRubyObjectpartition(ThreadContext context, IRubyObject self, Block block) static IRubyObjectreject(ThreadContext context, IRubyObject self, Block block) static IRubyObjectreverse_each(ThreadContext context, IRubyObject self, Block block) static IRubyObjectreverse_each(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectselect(ThreadContext context, IRubyObject self, Block block) static IRubyObjectselectCommon(ThreadContext context, IRubyObject self, Block block, String methodName) static IRubyObjectsort(ThreadContext context, IRubyObject self, Block block) static IRubyObjectsort_by(ThreadContext context, IRubyObject self, Block block) static IRubyObjectsum(ThreadContext context, IRubyObject self, Block block) static IRubyObjectsum(ThreadContext context, IRubyObject self, IRubyObject init, Block block) static IRubyObjectsumAdd(ThreadContext context, IRubyObject lhs, IRubyObject rhs, SingleDouble c) static IRubyObjectsumCommon(ThreadContext context, IRubyObject self, IRubyObject init, Block block) static IRubyObjectsumCommon(ThreadContext context, CallSite each, IRubyObject self, IRubyObject init, Block block) static IRubyObjecttake(ThreadContext context, IRubyObject self, IRubyObject n, Block block) static IRubyObjecttake_while(ThreadContext context, IRubyObject self, Block block) static IRubyObjecttakeItems(ThreadContext context, IRubyObject enumerable) Take all items from the given enumerable and insert them into a new array.static IRubyObjecttally(ThreadContext context, IRubyObject self) static IRubyObjecttally(ThreadContext context, IRubyObject self, IRubyObject hashArg) static IRubyObjectto_a(ThreadContext context, IRubyObject self) static IRubyObjectto_a(ThreadContext context, IRubyObject self, IRubyObject arg) static IRubyObjectto_a(ThreadContext context, IRubyObject self, IRubyObject[] args) static IRubyObjectto_h(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectuniq(ThreadContext context, IRubyObject self, Block block) static IRubyObjectzip(ThreadContext context, IRubyObject self, Block block) static IRubyObjectzip(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectzip(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObjectzipCommon(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectzipCommon(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block, ObjectObjectIntFunction<ThreadContext, IRubyObject, IRubyObject> nextElement) static IRubyObjectzipCommon(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObjectzipCommon(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block, ObjectObjectIntFunction<ThreadContext, IRubyObject, IRubyObject> nextElement) static IRubyObjectzipCommonAry(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectzipCommonAry(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObjectzipCommonEnum(ThreadContext context, IRubyObject self, IRubyObject[] args, Block block) static IRubyObjectzipCommonEnum(ThreadContext context, IRubyObject self, IRubyObject arg0, Block block) static IRubyObjectzipEnumNext(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
-