narr

package narr

Members list

Packages

package narr.native

Type members

Classlikes

case class ByteArrayBuilder(initCapacity: Int) extends TypedArrayBuilder[Byte]

Attributes

Source
NArrayBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class DoubleArrayBuilder(initCapacity: Int) extends TypedArrayBuilder[Double]

Attributes

Source
NArrayBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class FloatArrayBuilder(initCapacity: Int) extends TypedArrayBuilder[Float]

Attributes

Source
NArrayBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class IntArrayBuilder(initCapacity: Int) extends TypedArrayBuilder[Int]

Attributes

Source
NArrayBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object NArray

Attributes

Source
package.scala
Supertypes
class Object
trait Matchable
class Any
Self type
NArray.type
class NArrayAsIterableOnce[T](a: NArray[T]) extends IterableOnce[T]

Attributes

Source
package.scala
Supertypes
trait IterableOnce[T]
class Object
trait Matchable
class Any
object NArrayBuilder

Attributes

Companion
trait
Source
NArrayBuilder.scala
Supertypes
class Object
trait Matchable
class Any
Self type
trait NArrayBuilder[T]

Design notes:

Design notes:

  • If you already know the size of the result, you wouldn't use a builder at all.
  • Minimize memory footprint and copy operations.
  • som-snytt
    • That's an interesting experiment worth benchmarking. Personally I'd optimize for new Builder().addAll(xs).result but it depends.
    • I like the idea of keeping the "strategy" in a var instead of a confusing if/else.
    • Alternatively, switch on the current state

Type parameters

T

type of the Array elements.

Attributes

Companion
object
Source
NArrayBuilder.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class ShortArrayBuilder(initCapacity: Int) extends TypedArrayBuilder[Short]

Attributes

Source
NArrayBuilder.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait TypedArrayBuilder[T](using x$1: ClassTag[T]) extends NArrayBuilder[T]

Attributes

Source
NArrayBuilder.scala
Supertypes
trait NArrayBuilder[T]
class Object
trait Matchable
class Any
Known subtypes

Types

type ArrayElementType[T <: NativeTypedArray | Array[_]] = T match { case ByteArray => Byte case ShortArray => Short case IntArray => Int case FloatArray => Float case DoubleArray => Double case Array[t] => t }

Attributes

Source
package.scala

Attributes

Source
package.scala

Attributes

Source
package.scala

Attributes

Source
package.scala

Attributes

Source
package.scala
type NArr[T] = NArr[T]

Attributes

Source
package.scala
type NArray[T] = NArray[T]

Attributes

Source
package.scala
type NativeArray[T] = Array[T]

Attributes

Source
package.scala

Attributes

Source
package.scala
type SortableNArr[T] = SortableNArr[T]

Attributes

Source
package.scala

Attributes

Source
package.scala

Value members

Concrete fields

Attributes

Source
package.scala

Implicits

Implicits

implicit def nArray2NArr[T](nArr: NArray[T]): NArr[T] & NArray[T]

Attributes

Source
package.scala

Exports

Defined exports

export ba2io
Exported from Extensions

Attributes

Source
Extensions.scala
export da2io
Exported from Extensions

Attributes

Source
Extensions.scala
export fa2io
Exported from Extensions

Attributes

Source
Extensions.scala
export ia2io
Exported from Extensions

Attributes

Source
Extensions.scala
export nArray2IterableOnce[T](using ct: ClassTag[T])
Exported from Extensions

Attributes

Source
Extensions.scala
Exported from Extensions

Attributes

Source
Extensions.scala
export sa2io
Exported from Extensions

Attributes

Source
Extensions.scala