package control
- Alphabetic
- By Inheritance
- control
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- macro def fillArrayOfInt(times: Int)(f: Int): Array[Int]
- def fillArraySeq[T <: AnyRef](times: Int)(f: => T)(implicit classTag: ClassTag[T]): ArraySeq[T]
Evaluates the given expression
fwith typeTthe given number oftimesand stores the result in a scala.collection.immutable.ArraySeq.Evaluates the given expression
fwith typeTthe given number oftimesand stores the result in a scala.collection.immutable.ArraySeq.Example Usage
val result = repeat(15) { System.in.read() }
- times
The number of times the expression f
is evaluated. Thetimesexpression is evaluated exactly once.- f
An expression that is evaluated the given number of times unless an exception is thrown. Hence, even though
fis not a by-name parameter, it behaves in the same way.- returns
The result of the evaluation of the expression
fthe given number of times stored in anIndexedSeq. Iftimesis zero an empty sequence is returned.
- Note
This is a macro.
- macro def fillIntArray(times: Int)(f: Int): ArraySeq[Int]
Evaluates the given expression
fthe given number oftimesand stores the result in an scala.collection.immutable.ArraySeq[Int.Evaluates the given expression
fthe given number oftimesand stores the result in an scala.collection.immutable.ArraySeq[Int.Example Usage
val result = fillIntArray(15) { System.in.readByte() }
- times
The number of times the expression
fis evaluated. Thetimesexpression is evaluated exactly once.- f
An expression that is evaluated the given number of times unless an exception is thrown. Hence, even though
fis not a by-name parameter, it behaves in the same way.- returns
The result of the evaluation of the expression
fthe given number of times stored in anIndexedSeq. Iftimesis zero an empty sequence is returned.
- Note
This is a macro.
- def find[T <: AnyRef](data: ArraySeq[T])(compareTo: (T) => Int): Option[T]
- def find[T <: AnyRef](data: ArraySeq[T], comparable: java.lang.Comparable[T]): Option[T]
Finds the value identified by the given comparator, if any.
Finds the value identified by the given comparator, if any.
- data
An array sorted in ascending order according to the test done by the comparator.
- comparable
A comparable which is used to search for the matching value. If the object matches multiple values, the returned value is not precisely specified.
- Note
The comparator has to be able to handle
,nullvalues if the given array may contain null values.The array must contain less than Int.MaxValue/2 values.
- final macro def forFirstN[T <: AnyRef](l: List[T], n: Int)(f: (T) => Unit): Unit
Executes the given function
ffor the firstnvalues of the given list.Executes the given function
ffor the firstnvalues of the given list. The behavior is undefined if the given list does not have at leastnelements.- Note
This is a macro.
- final macro def foreachNonNullValue[T <: AnyRef](a: Array[T])(f: (Int, T) => Unit): Unit
Iterates over a given array
aand calls the given functionffor each non-null value in the array.Iterates over a given array
aand calls the given functionffor each non-null value in the array.- Note
This is a macro.
- final macro def foreachWithIndex[T <: AnyRef](a: Array[T])(f: (T, Int) => Unit): Unit
Allocation free, local iteration over all elements of an array.
Allocation free, local iteration over all elements of an array.
- Note
This is a macro.
- macro def iterateTo(from: Int, to: Int)(f: (Int) => Unit): Unit
Iterates over the given range of integer values
[from,to]and calls the given function f for each value.Iterates over the given range of integer values
[from,to]and calls the given function f for each value.If
fromis smaller or equal toto,fwill not be called.- Note
This is a macro.
- macro def iterateUntil(from: Int, until: Int)(f: (Int) => Unit): Unit
Iterates over the given range of integer values
[from,until)and calls the given function f for each value.Iterates over the given range of integer values
[from,until)and calls the given function f for each value.If
fromis smaller thanuntil,fwill not be called. - macro def repeat(times: Int)(f: Unit): Unit
Runs the given function f the given number of times.
- object Comparable
Factory for creating a
Comparablebased on a function that enables the (one-way) comparison with value of a specific type.