Top Inners Fields Constructors Methods
org.jruby

public Class RubyRange

extends RubyObject
Class Inheritance
Annotations
@JRubyClass
name:Range
include:Enumerable
Imports
java.io.IOException, java.util.List, org.jruby.anno.JRubyClass, .JRubyMethod, org.jruby.api.API, .JRubyAPI, org.jruby.exceptions.JumpException, org.jruby.runtime.Arity, .Block, .BlockCallback, .CallBlock, .CallSite, .ClassIndex, .Helpers, .JavaSites, .ObjectMarshal, .Signature, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, .Variable, org.jruby.runtime.callsite.RespondToCallSite, org.jruby.runtime.component.VariableEntry, org.jruby.runtime.invokedynamic.MethodNames, org.jruby.runtime.marshal.MarshalDumper, .MarshalLoader, org.jruby.util.Numeric, .TypeConverter, org.jruby.util.io.RubyInputStream, .RubyOutputStream

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static interface
public static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private IRubyObject
private static final byte[]
private IRubyObject
private boolean
private boolean
private boolean
private boolean
private static final ObjectMarshal<T>
Inherited from org.jruby.RubyObject:
IVAR_INSPECTING_OBJECT_ALLOCATOROBJECT_ALLOCATORREIFYING_OBJECT_ALLOCATOR

Constructor Summary

AccessConstructor and Description
private
RubyRange(Ruby runtime, RubyClass klass)

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
pack-priv final long[]
begLen(ThreadContext context, long len, int err)

pack-priv final long
begLen0(ThreadContext context, long len)

pack-priv final long
begLen1(ThreadContext context, long len, long beg)

pack-priv final int[]
begLenInt(int len, final int err)
Deprecated since 10.0.

pack-priv final int[]
begLenInt(ThreadContext context, int len, final int err)

private static boolean
private static boolean
private static void
pack-priv final boolean
checkBegin(ThreadContext context, long length)

public void
public IRubyObject
count(ThreadContext context, Block block)

public RubyBoolean
private boolean
private boolean
public static RubyClass
createRangeClass(ThreadContext context, RubyClass Object, RubyModule Enumerable)

private static boolean
private boolean
public IRubyObject
each(final ThreadContext context, final Block block)

public IRubyObject
end(ThreadContext context)

public IRubyObject
public IRubyObject
private IRubyObject
equalityInner(ThreadContext context, IRubyObject other, MethodNames equalityCheck)

public RubyBoolean
public RubyBoolean
exclude_end_p()
Deprecated

public IRubyObject
public IRubyObject
private void
fixnumEach(ThreadContext context, Block block)

private void
private void
public RubyFixnum
hash(ThreadContext
the current thread context
context
)

Overrides org.jruby.RubyBasicObject.hash.

Will return the hash code of this object.

public IRubyObject
include_p(ThreadContext context, final IRubyObject obj)

private IRubyObject
includeCommon(ThreadContext context, final IRubyObject val, boolean useStringCover)

private void
init(ThreadContext context, IRubyObject begin, IRubyObject end, boolean isExclusive)

public IRubyObject
initialize(ThreadContext context, IRubyObject[] args, Block unusedBlock)

public IRubyObject
initialize_copy(ThreadContext
the thread context
context
,
IRubyObject
the original
original
)

Overrides org.jruby.RubyBasicObject.initialize_copy.

Initializes this object as a copy of the original, that is the parameter to this object.

public RubyString
inspect(final ThreadContext context)

Overrides org.jruby.RubyBasicObject.inspect.

Overrides default org.jruby.runtime.builtin.IRubyObject.inspect.

Returns a string containing a human-readable representation of obj.

private static RubyString
inspectValue(final ThreadContext context, IRubyObject value)

private static IRubyObject
inspectValueRecursive(ThreadContext context, IRubyObject state, IRubyObject obj, boolean recur)

private RubyArray<T extends IRubyObject>
public final boolean
public static boolean
isRangeLike(ThreadContext
current context
context
,
IRubyObject
possibly range-like object
obj
,
RespondToCallSite
respond_to? site for begin
respond_to_begin
,
RespondToCallSite
respond_to? site for end
respond_to_end
)

Return true if the given object responds to "begin" and "end" methods.

public static boolean
isRangeLike(ThreadContext
current context
context
,
IRubyObject
possibly range-like object
obj
,
JavaSites.CheckedSites
checked site for begin
begin_checked
,
JavaSites.CheckedSites
checked site for end
end_checked
,
JavaSites.CheckedSites
checked site for exclude_end?
exclude_end_checked
)

Return true if the given object responds to "begin", "end" and "exclude_end?" methods.

private static boolean
public IRubyObject
public IRubyObject
private static boolean
public IRubyObject
max(ThreadContext context, Block block)

public IRubyObject
max(ThreadContext context, IRubyObject arg, Block block)

public IRubyObject
min(ThreadContext context, Block block)

public IRubyObject
min(ThreadContext context, IRubyObject arg, Block block)

public IRubyObject
minmax(ThreadContext context, Block block)

public static RubyRange
newBeginlessRange(ThreadContext context, long end, boolean isExclusive)

public static RubyRange
newEndlessRange(ThreadContext context, long begin, boolean isExclusive)

public static RubyRange
public static RubyRange
newExclusiveRange(ThreadContext context, long begin, long end)

public static RubyRange
public static RubyRange
newInclusiveRange(ThreadContext context, long begin, long end)

public static RubyRange
newRange(ThreadContext context, IRubyObject begin, IRubyObject end, boolean isExclusive)

public static RubyRange
newRange(ThreadContext context, long begin, long end, boolean isExclusive)

public IRubyObject
op_equal(ThreadContext context, IRubyObject other)

Overrides org.jruby.RubyBasicObject.op_equal.

Implements org.jruby.runtime.builtin.IRubyObject.op_equal.

rb_obj_equal Will by default use identity equality to compare objects.

public IRubyObject
op_mod(final ThreadContext context, IRubyObject step)

public static IRubyObject
rangeBeginLength(ThreadContext context, IRubyObject range, int len, int[] begLen, int err)

private static IRubyObject
rangeBeginLengthError(ThreadContext context, int beg, int end, boolean excludeEnd, int err)

private void
public static RubyRange

Returns:

a proper Range based on the results of calling those methods
rangeFromRangeLike
(ThreadContext
current context
context
,
IRubyObject
range-like object
rangeLike
,
CallSite
"begin" call site
beginSite
,
CallSite
"end" call site
endSite
,
CallSite
"exclude_end?" call site
excludeEndSite
)

Given a range-line object that response to "begin", "end", construct a proper range by calling those methods and "exclude_end?" with the given call sites.

private IRubyObject
private boolean
private boolean
private static IRubyObject
private static int
private static IRubyObject
private boolean
public static RubyRange.RangeLike
public IRubyObject
private void
private void
private void
private void
private void
private void
private static IRubyObject
reverseSize(ThreadContext context, RubyRange recv, IRubyObject[] args)

A size method for reverse_each suitable for lambda method reference implementation of SizeFn#size(ThreadContext, IRubyObject, IRubyObject[])

private static JavaSites.RangeSites
sites(ThreadContext context)

Hides org.jruby.RubyObject.sites.

Retrieve the call sites for this class.

private static IRubyObject
size(ThreadContext ctx, RubyRange recv, IRubyObject[] args)

A size method suitable for lambda method reference implementation of SizeFn#size(ThreadContext, IRubyObject, IRubyObject[])

public IRubyObject
public IRubyObject
step(final ThreadContext context, final Block block)

public IRubyObject
step(final ThreadContext context, IRubyObject step, final Block block)

private IRubyObject
stepCommon(ThreadContext context, IRubyObject stepArg, Block block)

private IRubyObject
private static IRubyObject
stepSize(ThreadContext context, RubyRange self, IRubyObject[] args)

A step size method suitable for lambda method reference implementation of SizeFn#size(ThreadContext, IRubyObject, IRubyObject[])

private void
stringStep(ThreadContext context, IRubyObject step, Block block, RubyString strBegin)

private void
symbolStep(ThreadContext context, IRubyObject step, Block block, RubyString symBegin)

public IRubyObject
to_a(ThreadContext context, final Block block)

public IRubyObject
private RubyString
to_s(final Ruby runtime)

Inherited from org.jruby.RubyObject:
attachToObjectSpacecallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitcallInitconvertToTypedigdig1dig2eqlInternalequalInternalequalsfinishObjectClassgetNativeClassIndexhashCodeinspectop_eqqputsspecificEvaltoRubyStringtoString