Top Description Inners Constructors Methods
org.jruby.javasupport.ext

public abstract Class JavaUtil

extends Object
Class Inheritance
Imports
org.jruby.*, org.jruby.anno.JRubyMethod, .JRubyModule, org.jruby.api.Create, org.jruby.internal.runtime.methods.JavaMethod, org.jruby.java.proxies.JavaProxy, org.jruby.javasupport.Java, org.jruby.runtime.Block, .Helpers, .ThreadContext, org.jruby.runtime.builtin.IRubyObject, org.jruby.util.Inspector, .RubyStringBuilder, java.lang.reflect.Constructor, .InvocationTargetException

Java::JavaUtil package extensions.
Author
kares

Nested and Inner Type Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
define(ThreadContext context, RubyModule Enumerable)

private static Collection<E>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JavaUtilback to summary
public JavaUtil()

Method Detail

defineback to summary
public static void define(ThreadContext context, RubyModule Enumerable)
tryNewEqualInstanceback to summary
private static Collection<E> tryNewEqualInstance(final Collection<E> coll)
org.jruby.javasupport.ext back to summary

public Class JavaUtil.Collection

extends Object
Class Inheritance
Annotations
@JRubyModule
name:Java::JavaUtil::Collection
include:Enumerable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static IRubyObject
append(final IRubyObject self, final IRubyObject item)

public static IRubyObject
clone(final ThreadContext context, final IRubyObject self)

pack-priv static RubyModule
define(ThreadContext context, final RubyModule proxy, RubyModule Enumerable)

public static IRubyObject
dup(final ThreadContext context, final IRubyObject self)

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

public static IRubyObject
each_with_index(final ThreadContext context, final IRubyObject self, final Block block)

public static IRubyObject
first(final ThreadContext context, final IRubyObject self)

public static IRubyObject
first(final ThreadContext context, final IRubyObject self, final IRubyObject count)

public static RubyBoolean
include_p(final ThreadContext context, final IRubyObject self, final IRubyObject obj)

public static RubyString
inspect(final ThreadContext context, final IRubyObject self)

pack-priv static void
inspectElements(final ThreadContext context, final RubyString buf, final Collection<E> coll)

public static IRubyObject
join(final ThreadContext context, final IRubyObject self)

public static IRubyObject
join(final ThreadContext context, final IRubyObject self, final IRubyObject sep)

public static RubyNumeric
length(final ThreadContext context, final IRubyObject self)

public static IRubyObject
op_minus(final ThreadContext context, final IRubyObject self, final IRubyObject coll)

public static IRubyObject
op_plus(final ThreadContext context, final IRubyObject self, final IRubyObject coll)

public static RubyArray<T extends IRubyObject>
to_a(final ThreadContext context, final IRubyObject self)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Collectionback to summary
public Collection()

Method Detail

appendback to summary
public static IRubyObject append(final IRubyObject self, final IRubyObject item)
Annotations
@JRubyMethod
name:<<
cloneback to summary
public static IRubyObject clone(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
defineback to summary
pack-priv static RubyModule define(ThreadContext context, final RubyModule proxy, RubyModule Enumerable)
dupback to summary
public static IRubyObject dup(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
eachback to summary
public static IRubyObject each(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@JRubyMethod
each_with_indexback to summary
public static IRubyObject each_with_index(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@JRubyMethod
firstback to summary
public static IRubyObject first(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
name:first, ruby_first
firstback to summary
public static IRubyObject first(final ThreadContext context, final IRubyObject self, final IRubyObject count)
Annotations
@JRubyMethod
name:first, ruby_first
include_pback to summary
public static RubyBoolean include_p(final ThreadContext context, final IRubyObject self, final IRubyObject obj)
Annotations
@JRubyMethod
name:include?, member?
inspectback to summary
public static RubyString inspect(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
name:inspect
inspectElementsback to summary
pack-priv static void inspectElements(final ThreadContext context, final RubyString buf, final Collection<E> coll)
joinback to summary
public static IRubyObject join(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
joinback to summary
public static IRubyObject join(final ThreadContext context, final IRubyObject self, final IRubyObject sep)
Annotations
@JRubyMethod
lengthback to summary
public static RubyNumeric length(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
name:length, size
op_minusback to summary
public static IRubyObject op_minus(final ThreadContext context, final IRubyObject self, final IRubyObject coll)
Annotations
@JRubyMethod
name:-
op_plusback to summary
public static IRubyObject op_plus(final ThreadContext context, final IRubyObject self, final IRubyObject coll)
Annotations
@JRubyMethod
name:+
to_aback to summary
public static RubyArray<T extends IRubyObject> to_a(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
name:to_a, entries
org.jruby.javasupport.ext back to summary

public Class JavaUtil.Enumeration

extends Object
Class Inheritance
Annotations
@JRubyModule
name:Java::JavaUtil::Enumeration
include:Enumerable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static RubyModule
define(ThreadContext context, final RubyModule proxy, RubyModule Enumerable)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Enumerationback to summary
public Enumeration()

Method Detail

defineback to summary
pack-priv static RubyModule define(ThreadContext context, final RubyModule proxy, RubyModule Enumerable)
eachback to summary
public static IRubyObject each(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@JRubyMethod
org.jruby.javasupport.ext back to summary

private Class JavaUtil.InspectTimeZone

extends JavaMethodZero
Class Inheritance

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public IRubyObject
call(final ThreadContext context, final IRubyObject self, final RubyModule clazz, final String name)

Implements abstract org.jruby.internal.runtime.methods.JavaMethod.JavaMethodZeroOrN.call.

Inherited from org.jruby.internal.runtime.methods.JavaMethod.JavaMethodZero:
callgetAritygetSignature

Constructor Detail

InspectTimeZoneback to summary
pack-priv InspectTimeZone(RubyModule implClass)

Method Detail

callback to summary
public IRubyObject call(final ThreadContext context, final IRubyObject self, final RubyModule clazz, final String name)

Implements abstract org.jruby.internal.runtime.methods.JavaMethod.JavaMethodZeroOrN.call.

Annotations
@Override
org.jruby.javasupport.ext back to summary

public Class JavaUtil.Iterator

extends Object
Class Inheritance
Annotations
@JRubyModule
name:Java::JavaUtil::Iterator
include:Enumerable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv static RubyModule
define(ThreadContext context, final RubyModule proxy, RubyModule Enumerable)

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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Iteratorback to summary
public Iterator()

Method Detail

defineback to summary
pack-priv static RubyModule define(ThreadContext context, final RubyModule proxy, RubyModule Enumerable)
eachback to summary
public static IRubyObject each(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@JRubyMethod
org.jruby.javasupport.ext back to summary

public Class JavaUtil.List

extends Object
Class Inheritance
Annotations
@JRubyModule
name:Java::JavaUtil::List

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Constructor Summary

AccessConstructor and Description
public
List()

Method Summary

Modifier and TypeMethod and Description
public static IRubyObject
aref(final ThreadContext context, final IRubyObject self, final IRubyObject idx)

public static IRubyObject
aref(final ThreadContext context, final IRubyObject self, final IRubyObject idx, final IRubyObject len)

public static IRubyObject
aset(final ThreadContext context, final IRubyObject self, final IRubyObject idx, final IRubyObject val)

public static IRubyObject
first(final ThreadContext context, final IRubyObject self)

public static IRubyObject
first(final ThreadContext context, final IRubyObject self, final IRubyObject count)

public static IRubyObject
index(final ThreadContext context, final IRubyObject self, final Block block)

public static IRubyObject
index(final ThreadContext context, final IRubyObject self, final IRubyObject val, final Block ignoredBlock)

public static IRubyObject
last(final ThreadContext context, final IRubyObject self)

public static IRubyObject
last(final ThreadContext context, final IRubyObject self, final IRubyObject count)

public static IRubyObject
rindex(final ThreadContext context, final IRubyObject self, final Block block)

public static IRubyObject
rindex(final ThreadContext context, final IRubyObject self, final IRubyObject val, final Block ignoredBlock)

public static IRubyObject
sort(final ThreadContext context, final IRubyObject self, final Block block)

public static IRubyObject
sort_bang(final ThreadContext context, final IRubyObject self, final Block block)

private static void
sortImpl(final ThreadContext context, final List<E> list, final Block block)

public static RubyArray<T extends IRubyObject>
to_a(final ThreadContext context, final IRubyObject self)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Listback to summary
public List()

Method Detail

arefback to summary
public static IRubyObject aref(final ThreadContext context, final IRubyObject self, final IRubyObject idx)
Annotations
@JRubyMethod
name:[]
arefback to summary
public static IRubyObject aref(final ThreadContext context, final IRubyObject self, final IRubyObject idx, final IRubyObject len)
Annotations
@JRubyMethod
name:[]
asetback to summary
public static IRubyObject aset(final ThreadContext context, final IRubyObject self, final IRubyObject idx, final IRubyObject val)
Annotations
@JRubyMethod
name:[]=
firstback to summary
public static IRubyObject first(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
name:first, ruby_first
firstback to summary
public static IRubyObject first(final ThreadContext context, final IRubyObject self, final IRubyObject count)
Annotations
@JRubyMethod
name:first, ruby_first
indexback to summary
public static IRubyObject index(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@JRubyMethod
name:index
indexback to summary
public static IRubyObject index(final ThreadContext context, final IRubyObject self, final IRubyObject val, final Block ignoredBlock)
Annotations
@JRubyMethod
name:index
lastback to summary
public static IRubyObject last(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
name:last, ruby_last
lastback to summary
public static IRubyObject last(final ThreadContext context, final IRubyObject self, final IRubyObject count)
Annotations
@JRubyMethod
name:last, ruby_last
rindexback to summary
public static IRubyObject rindex(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@JRubyMethod
name:rindex
rindexback to summary
public static IRubyObject rindex(final ThreadContext context, final IRubyObject self, final IRubyObject val, final Block ignoredBlock)
Annotations
@JRubyMethod
name:rindex
sortback to summary
public static IRubyObject sort(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@SuppressWarnings:unchecked
@JRubyMethod
name:sort, ruby_sort
sort_bangback to summary
public static IRubyObject sort_bang(final ThreadContext context, final IRubyObject self, final Block block)
Annotations
@SuppressWarnings:unchecked
@JRubyMethod
name:sort!
sortImplback to summary
private static void sortImpl(final ThreadContext context, final List<E> list, final Block block)
to_aback to summary
public static RubyArray<T extends IRubyObject> to_a(final ThreadContext context, final IRubyObject self)
Annotations
@JRubyMethod
name:to_a, to_ary
org.jruby.javasupport.ext back to summary

private final Class JavaUtil.List.BlockComparator

extends Object
implements Comparator
Class Inheritance
All Implemented Interfaces
java.util.Comparator

Field Summary

Modifier and TypeField and Description
private final Block
pack-priv final ThreadContext

Constructor Summary

AccessConstructor and Description
pack-priv
BlockComparator(final ThreadContext context, final Block block)

Method Summary

Modifier and TypeMethod and Description
public int
compare(final Object
the first object to be compared.
o1
,
final Object
the second object to be compared.
o2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

public final IRubyObject
compare(final ThreadContext context, final IRubyObject o1, final IRubyObject o2)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

blockback to summary
private final Block block
contextback to summary
pack-priv final ThreadContext context

Constructor Detail

BlockComparatorback to summary
pack-priv BlockComparator(final ThreadContext context, final Block block)

Method Detail

compareback to summary
public int compare(final Object o1, final Object o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
o1:Object

the first object to be compared.

o2:Object

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override
compareback to summary
public final IRubyObject compare(final ThreadContext context, final IRubyObject o1, final IRubyObject o2)
org.jruby.javasupport.ext back to summary

private final Class JavaUtil.List.SpaceshipComparator

extends Object
implements Comparator
Class Inheritance
All Implemented Interfaces
java.util.Comparator

Field Summary

Modifier and TypeField and Description
pack-priv final ThreadContext

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
compare(final Object
the first object to be compared.
o1
,
final Object
the second object to be compared.
o2
)

Implements java.util.Comparator.compare.

Compares its two arguments for order.

public final IRubyObject
compare(final ThreadContext context, final IRubyObject o1, final IRubyObject o2)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

contextback to summary
pack-priv final ThreadContext context

Constructor Detail

SpaceshipComparatorback to summary
pack-priv SpaceshipComparator(final ThreadContext context)

Method Detail

compareback to summary
public int compare(final Object o1, final Object o2)

Implements java.util.Comparator.compare.

Doc from java.util.Comparator.compare.

Compares its two arguments for order. Returns a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

The implementor must ensure that signum(compare(x, y)) == -signum(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.)

The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0.

Finally, the implementor must ensure that compare(x, y)==0 implies that signum(compare(x, z))==signum(compare(y, z)) for all z.

Parameters
o1:Object

the first object to be compared.

o2:Object

the second object to be compared.

Returns:int

a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.

Annotations
@Override
@SuppressWarnings:unchecked
compareback to summary
public final IRubyObject compare(final ThreadContext context, final IRubyObject o1, final IRubyObject o2)