Package org.jruby
Class RubyEnumerator
java.lang.Object
org.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyEnumerator
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<IRubyObject>,Iterator<Object>,InstanceVariables,InternalVariables,IRubyObject,CoreObjectType
Implementation of Ruby's Enumerator module.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classInternal Enumerator::FeedValue class to be shared between enumerator and its next-er Fiber.static interfaceRubyEnumerator.SizeFn<T extends IRubyObject>"Function" type for java-created enumerators with size.Nested classes/interfaces inherited from class org.jruby.RubyObject
RubyObject.DataNested classes/interfaces inherited from class org.jruby.RubyBasicObject
RubyBasicObject.Finalizer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.jruby.RubyObject
IVAR_INSPECTING_OBJECT_ALLOCATOR, OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATORFields 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, IS_OVERLAID_F, metaClass, NEVER, NIL_F, REFINED_MODULE_F, STAMP_OFFSET, TAINTED_F, UNDEF, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F, USER9_F, USERA_F, VAR_TABLE_OFFSET, varTable, varTableStampFields inherited from interface org.jruby.runtime.builtin.IRubyObject
NULL_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionstatic IRubyObject__from(ThreadContext context, IRubyObject klass, IRubyObject[] args) static RubyClassdefineEnumerator(ThreadContext context, RubyClass Object, RubyModule Enumerable) dup()RubyMethod dup.each(ThreadContext context, Block block) Send current block and supplied args to method on target.each(ThreadContext context, IRubyObject[] args, Block block) each_cons(ThreadContext context, IRubyObject arg, Block block) each_entry(ThreadContext context, Block block) each_entry(ThreadContext context, IRubyObject[] args, Block block) each_entry(ThreadContext context, IRubyObject arg0, Block block) each_slice(ThreadContext context, IRubyObject arg, Block block) each_with_index(ThreadContext context, Block block) each_with_object(ThreadContext context, IRubyObject arg, Block block) static IRubyObjectenumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method) static IRubyObjectenumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method, IRubyObject arg) static IRubyObjectenumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method, IRubyObject[] args) static IRubyObjectenumeratorize(Ruby runtime, IRubyObject object, String method) static IRubyObjectenumeratorize(Ruby runtime, IRubyObject object, String method, IRubyObject arg) static IRubyObjectenumeratorize(Ruby runtime, IRubyObject object, String method, IRubyObject... args) static IRubyObjectenumeratorizeWithSize(ThreadContext context, IRubyObject object, String method, IRubyObject arg, IRubyObject size) static <T extends IRubyObject>
IRubyObjectenumeratorizeWithSize(ThreadContext context, T object, String method, RubyEnumerator.SizeFn<T> sizeFn) static <T extends IRubyObject>
IRubyObjectenumeratorizeWithSize(ThreadContext context, T object, String method, IRubyObject[] args, RubyEnumerator.SizeFn<T> sizeFn) static <T extends IRubyObject>
IRubyObjectenumeratorizeWithSize(ThreadContext context, T object, String method, IRubyObject[] args, RubyEnumerator.SizeFn<T> sizeFn, boolean keywords) static <T extends IRubyObject>
RubyEnumeratorenumWithSize(ThreadContext context, T object, String method, RubyEnumerator.SizeFn<T> sizeFn) static <T extends IRubyObject>
RubyEnumeratorenumWithSize(ThreadContext context, T object, String method, IRubyObject[] args, RubyEnumerator.SizeFn<T> sizeFn) Transform object into an Enumerator with the given sizebooleanhasNext()initialize(ThreadContext context) initialize(ThreadContext context, Block block) initialize(ThreadContext context, IRubyObject[] args) Deprecated.initialize(ThreadContext context, IRubyObject[] args, Block block) Deprecated.initialize(ThreadContext context, IRubyObject size, Block block) inspect(ThreadContext context) Returns a string containing a human-readable representation of obj.next()static IRubyObjectproduce(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) MRI: enumerator_s_producevoidremove()longsize()final IRubyObjectsize(ThreadContext context) spliterator(int mod) stream()stream(boolean parallel) with_index(ThreadContext context, Block block) with_index(ThreadContext context, IRubyObject arg, Block block) with_object(ThreadContext context, IRubyObject arg, Block block) Methods inherited from class org.jruby.RubyObject
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, callInit, convertToType, dig, dig1, dig2, eqlInternal, equalInternal, equals, finishObjectClass, getNativeClassIndex, hashCode, inspect, op_eqq, puts, specificEval, toRubyString, toStringMethods inherited from class org.jruby.RubyBasicObject
addFinalizer, addFinalizer, anyToString, asJavaString, asString, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callMethod, callSuper, checkArrayType, checkCallMethod, checkCallMethod, checkFrozen, checkStringType, cloneSetup, compareTo, convertToArray, convertToFloat, convertToHash, convertToInteger, convertToInteger, convertToInteger, convertToString, copyInstanceVariablesInto, copySpecialInstanceVariables, dataGetStruct, dataGetStructChecked, dataWrapStruct, decode, display, dupFinalizer, dupSetup, ensureInstanceVariablesSettable, eql, eql_p, eql_p, equal_p, evalUnder, extend, fastGetInstanceVariable, fastGetInternalVariable, fastHasInstanceVariable, fastHasInternalVariable, fastSetInstanceVariable, fastSetInternalVariable, finishBasicObjectClass, forEachInstanceVariable, forEachInstanceVariableName, freeze, frozen_p, getCurrentContext, getFFIHandle, getFlag, getInstanceEvalClass, getInstanceEvalClass, getInstanceVariable, getInstanceVariableList, getInstanceVariableNameList, getInstanceVariables, getInternalVariable, getInternalVariables, getJavaClass, getMarshalVariableList, getMetaClass, getMetaClass, getNativeHandle, getNativeTypeIndex, getObjectId, getRuntime, getSingletonClass, getSingletonClassClone, getSingletonClassCloneAndAttach, getSingletonClassCloneAndAttach, getType, getVariable, getVariableCount, getVariableList, getVariableNameList, hash, hash, hashyInspect, hasInstanceVariable, hasInstanceVariables, hasInternalVariable, hasVariables, id, infectBy, initialize_copy, initialize_copy, inspect, inspectHashCode, instance_eval, instance_eval, instance_eval, instance_eval, instance_eval, instance_exec, instance_of_p, instance_variable_defined_p, instance_variable_get, instance_variable_set, instance_variables, isBuiltin, isClass, isFalse, isFrozen, isImmediate, isModule, isNil, isSpecialConst, isSpecialObject, isTaint, isTrue, isUntrusted, kind_of_p, makeMetaClass, makeMetaClass, makeMetaClassBootstrap, method, method, method, method_missing, methods, methods, nil_p, nonFixnumHashCode, nonFixnumHashCode, OBJ_INIT_COPY, objInitCopy, op_cmp, op_equal, op_match, op_not, op_not_equal, op_not_match, private_methods, protected_methods, public_methods, rbClone, rbClone, rbInspect, remove_instance_variable, removeFinalizers, removeInstanceVariable, removeInternalVariable, respond_to_p, respond_to_p, respondsTo, respondsToMissing, respondsToMissing, send, send, send, send, send, setFFIHandle, setFlag, setFrozen, setInstanceVariable, setInternalVariable, setMetaClass, setNativeHandle, setTaint, setUntrusted, setVariable, singleton_method, singleton_method, singleton_method_added, singleton_method_removed, singleton_method_undefined, singleton_methods, singletonClass, specificEval, specificEval, specificEval, specificEval, syncVariables, syncVariables, taint, taint, tainted_p, testFrozen, testFrozen, to_a, to_a, to_s, to_s, toJava, trust, type, untaint, untrust, untrusted_p, validateInstanceVariable, validateInstanceVariable, validateInstanceVariable, variableTableContains, variableTableFastContains, variableTableFastFetch, variableTableFastStore, variableTableFetch, variableTableRemove, variableTableStore, variableTableSync, yieldUnder, yieldUnderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jruby.runtime.builtin.IRubyObject
checkStringType19, dup, marshalLiveVariablesMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
GENERATOR
- See Also:
-
LOOKAHEAD
- See Also:
-
FEEDVALUE
- See Also:
-
OBJECT
- See Also:
-
METHOD
- See Also:
-
ARGS
- See Also:
-
-
Method Details
-
defineEnumerator
public static RubyClass defineEnumerator(ThreadContext context, RubyClass Object, RubyModule Enumerable) -
enumWithSize
public static <T extends IRubyObject> RubyEnumerator enumWithSize(ThreadContext context, T object, String method, IRubyObject[] args, RubyEnumerator.SizeFn<T> sizeFn) Transform object into an Enumerator with the given size -
enumeratorizeWithSize
public static <T extends IRubyObject> IRubyObject enumeratorizeWithSize(ThreadContext context, T object, String method, IRubyObject[] args, RubyEnumerator.SizeFn<T> sizeFn, boolean keywords) -
enumeratorizeWithSize
public static <T extends IRubyObject> IRubyObject enumeratorizeWithSize(ThreadContext context, T object, String method, IRubyObject[] args, RubyEnumerator.SizeFn<T> sizeFn) -
enumeratorizeWithSize
public static <T extends IRubyObject> IRubyObject enumeratorizeWithSize(ThreadContext context, T object, String method, RubyEnumerator.SizeFn<T> sizeFn) -
enumWithSize
public static <T extends IRubyObject> RubyEnumerator enumWithSize(ThreadContext context, T object, String method, RubyEnumerator.SizeFn<T> sizeFn) -
enumeratorizeWithSize
public static IRubyObject enumeratorizeWithSize(ThreadContext context, IRubyObject object, String method, IRubyObject arg, IRubyObject size) -
enumeratorize
-
enumeratorize
public static IRubyObject enumeratorize(Ruby runtime, IRubyObject object, String method, IRubyObject arg) -
enumeratorize
public static IRubyObject enumeratorize(Ruby runtime, IRubyObject object, String method, IRubyObject... args) -
enumeratorize
public static IRubyObject enumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method) -
enumeratorize
public static IRubyObject enumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method, IRubyObject arg) -
enumeratorize
public static IRubyObject enumeratorize(Ruby runtime, RubyClass type, IRubyObject object, String method, IRubyObject[] args) -
__from
-
initialize
- Overrides:
initializein classRubyBasicObject
-
initialize
-
initialize
-
dup
Description copied from interface:IRubyObjectRubyMethod dup.- Specified by:
dupin interfaceIRubyObject- Overrides:
dupin classRubyBasicObject- Returns:
- a dup-ed object
-
each
Send current block and supplied args to method on target. According to MRI Block may not be given and "each" should just ignore it and call on through to underlying method. -
each
-
inspect
Description copied from class:RubyBasicObjectReturns a string containing a human-readable representation of obj. If not overridden, uses theto_smethod to generate the string. [ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]" Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"- Specified by:
inspectin interfaceIRubyObject- Overrides:
inspectin classRubyBasicObject
-
each_with_object
-
with_object
-
each_entry
-
each_entry
-
each_entry
-
each_slice
-
each_cons
-
size
-
size
public long size() -
each_with_index
-
with_index
-
with_index
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
stream
-
stream
-
spliterator
-
spliterator
-
produce
public static IRubyObject produce(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) MRI: enumerator_s_produce -
initialize
Deprecated. -
initialize
Deprecated.
-