blob: bf402a79680724f06b937895d4d9c05a0de8889c (
plain) (
tree)
|
|
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2002-2010, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
package scala.compat
import java.lang.System
object Platform {
type StackOverflowError = java.lang.StackOverflowError
type ConcurrentModificationException = java.util.ConcurrentModificationException
/**
* @param src ..
* @param srcPos ..
* @param dest ..
* @param destPos ..
* @param length ..
*/
@inline
def arraycopy(src: AnyRef, srcPos: Int, dest: AnyRef, destPos: Int, length: Int) {
System.arraycopy(src, srcPos, dest, destPos, length)
}
/** Create array of the same type as arrayInstance with the given
* length.
*
* @param elemClass ..
* @param length ..
* @return ..
*/
@inline
def createArray(elemClass: Class[_], length: Int): AnyRef =
java.lang.reflect.Array.newInstance(elemClass, length)
@inline
def arrayclear(arr: Array[Int]) { java.util.Arrays.fill(arr, 0) }
@inline
def getClassForName(name: String): Class[_] = java.lang.Class.forName(name)
val EOL = util.Properties.lineSeparator
/** The current time in milliseconds. The time is counted since 1 January 1970
* UTC.
*
* Note that the operating system timer used to obtain this value may be less
* precise than a millisecond. */
@inline
def currentTime: Long = System.currentTimeMillis()
@inline
def collectGarbage: Unit = System.gc()
/** The name of the default character set encoding as a string */
@inline
def defaultCharsetName: String = java.nio.charset.Charset.defaultCharset.name
}
|