Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.compat/Platform

Platform

scala.compat.Platform
objectPlatform

Attributes

Deprecated
[Since version 2.13.0]Will be removed in the future.
Source
Platform.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type

Members list

Type members

Deprecated types

This is a type alias forjava.util.ConcurrentModificationException, which may be thrown by methods that detect an invalid modification of an object.

This is a type alias forjava.util.ConcurrentModificationException, which may be thrown by methods that detect an invalid modification of an object. For example, many common collection types do not allow modifying a collection while it is being iterated over.

Attributes

Deprecated
[Since version 2.13.0]Use `java.util.ConcurrentModificationException` instead.
Source
Platform.scala

Thrown when a stack overflow occurs because a method or function recurses too deeply.

Thrown when a stack overflow occurs because a method or function recurses too deeply.

On the JVM, this is a type alias forjava.lang.StackOverflowError, which itself extendsjava.lang.Error. The same rules apply to catching ajava.lang.Error as for Java, that it indicates a serious problem that a reasonable application should not try and catch.

Attributes

Deprecated
[Since version 2.13.0]Use `java.lang.StackOverflowError` instead.
Source
Platform.scala

Value members

Deprecated methods

Assigns the value of 0 to each element in the array.

Assigns the value of 0 to each element in the array.

Value parameters

arr

A non-null Array[Int].

Attributes

Throws
Deprecated
[Since version 2.13.0]Use `java.util.Arrays#fill` instead.
Source
Platform.scala
defarraycopy(src:AnyRef,srcPos:Int,dest:AnyRef,destPos:Int,length:Int):Unit

Copieslength elements of arraysrc starting at positionsrcPos to the arraydest starting at positiondestPos.

Copieslength elements of arraysrc starting at positionsrcPos to the arraydest starting at positiondestPos. Ifsrc==dest, the copying will behave as if the elements copied fromsrc were first copied to a temporary array before being copied back into the array at the destination positions.

Value parameters

dest

A non-null array as destination for the copy.

destPos

The starting index in the destination array.

length

The number of elements to be copied.

src

A non-null array as source for the copy.

srcPos

The starting index in the source array.

Attributes

Throws

java.lang.ArrayStoreExceptionIf eithersrc ordest are not of type [java.lang.Array]; or if the element type ofsrc is not compatible with that ofdest.

java.lang.IndexOutOfBoundsExceptionIf eithersrcPos ordestPos are outside of the bounds of their respective arrays; or iflength is negative; or if there are less thanlength elements available aftersrcPos ordestPos insrc anddest respectively.

java.lang.NullPointerExceptionIf eithersrc ordest arenull.

Deprecated
[Since version 2.13.0]Use `java.lang.System#arraycopy` instead.
Source
Platform.scala

Runs the garbage collector.

Runs the garbage collector.

This is a request that the underlying JVM runs the garbage collector. The results of this call depends heavily on the JVM used. The underlying JVM is free to ignore this request.

Attributes

Deprecated
[Since version 2.13.0]Use `java.lang.System#gc` instead.
Source
Platform.scala
defcreateArray(elemClass:Class[_],length:Int):AnyRef

Creates a new array of the specified type and given length.

Creates a new array of the specified type and given length.

Note that ifelemClass is a subclass ofscala.AnyVal then the returned value is an Array of the corresponding java primitive type. For example, the following codescala.compat.Platform.createArray(classOf[Int], 4) returns an array of the java primitive typeint.

For ascala.AnyVal array, the values of the array are set to 0 fornumeric value types (scala.Double,scala.Float,scala.Long,scala.Int,scala.Char,scala.Short, andscala.Byte), andfalse forscala.Boolean. Creation of an array of typescala.Unit is not possible.

For subclasses ofscala.AnyRef, the values of the array are set tonull.

The caller must cast the returned value to the correct type.

Value parameters

elemClass

theClass object of the component type of the array

length

the length of the new array.

Attributes

Returns

an array of the given component type as anAnyRef.

Throws

java.lang.IllegalArgumentExceptionif componentType isscala.Unit orjava.lang.Void.TYPE

java.lang.NegativeArraySizeException if the specified length is negative

Example

val a = scala.compat.Platform.createArray(classOf[Int], 4).asInstanceOf[Array[Int]] // returns Array[Int](0, 0, 0, 0)
Deprecated
[Since version 2.13.0]Use `java.lang.reflect.Array#newInstance` instead.
Source
Platform.scala

The current time in milliseconds.

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.

Attributes

Deprecated
[Since version 2.13.0]Use `java.lang.System#currentTimeMillis` instead.
Source
Platform.scala

The name of the default character set encoding as a string

The name of the default character set encoding as a string

Attributes

Deprecated
[Since version 2.13.0]Use `java.nio.charset.Charset.defaultCharset#name` instead.
Source
Platform.scala

Returns theClass object associated with the class or interface with the given string name using the currentClassLoader.

Returns theClass object associated with the class or interface with the given string name using the currentClassLoader. On the JVM, invoking this method is equivalent to:java.lang.Class.forName(name)

For more information, please see the Java documentation forjava.lang.Class.

Value parameters

name

the fully qualified name of the desired class.

Attributes

Returns

theClass object for the class with the specified name.

Throws

java.lang.ClassNotFoundException if the class cannot be located

java.lang.ExceptionInInitializerError if the initialization provoked by this method fails

java.lang.LinkageError if the linkage fails

Example

val a = scala.compat.Platform.getClassForName("java.lang.Integer")  // returns the Class[_] for java.lang.Integer
Deprecated
[Since version 2.13.0]Use `java.lang.Class#forName` instead.
Source
Platform.scala

Deprecated fields

The default line separator.

The default line separator.

On the JVM, this is equivalent to calling the method:java.lang.System.lineSeparator

Attributes

Deprecated
[Since version 2.13.0]Use `java.lang.System#lineSeparator` instead.
Source
Platform.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp