org.jruby.util
Class ArraysUtil

java.lang.Object
  extended by org.jruby.util.ArraysUtil

public final class ArraysUtil
extends java.lang.Object


Constructor Summary
ArraysUtil()
           
 
Method Summary
static IRubyObject[] copyOf(IRubyObject[] source, int length)
          Returns a copy of an array of IRubyObject type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArraysUtil

public ArraysUtil()
Method Detail

copyOf

public static IRubyObject[] copyOf(IRubyObject[] source,
                                   int length)
Returns a copy of an array of IRubyObject type. This covers the copyOf method added in JDK6.

Parameters:
source - an array to be copied
Returns:
a copy of the source array, which may truncated or filled with nulls when the given length is not the same as source length
Throws:
java.lang.NegativeArraySizeException - if the length is negative
java.lang.NullPointerException - if the source is null


Copyright © 2002-2009 JRuby Team. All Rights Reserved.