SqCenOptLayer

ostrat.prid.psq.SqCenOptLayer
final class SqCenOptLayer[A <: AnyRef](val arrayUnsafe: Array[A]) extends AnyVal, LayerTcOpt[A]

A layer of immutable optional SqCen data for a SqGridSys square grid system, This is specialised for OptRef[A]. The tileGrid can map the SqCen coordinate of the tile to the index of the Arr. Hence most methods take an implicit SqGridSys square grid system parameter.

Attributes

Graph
Supertypes
trait LayerTcOpt[A]
class AnyVal
trait Matchable
class Any

Members list

Type members

Types

override type ThisT = SqCenOptLayer[A]

Value members

Concrete methods

def apply(hc: SqCen)(implicit gridSys: SqGridSys): Option[A]

Indexes in to this SqCenOptLayer using the tile centre coordinate, either passed as an SqCen or as row and column values.

Indexes in to this SqCenOptLayer using the tile centre coordinate, either passed as an SqCen or as row and column values.

Attributes

def apply(r: Int, c: Int)(implicit gridSys: SqGridSys): Option[A]

Indexes in to this SqCenOptLayer using the tile centre coordinate, either passed as an SqCen or as row and column values.

Indexes in to this SqCenOptLayer using the tile centre coordinate, either passed as an SqCen or as row and column values.

Attributes

def applyUnsafe(hc: SqCen)(implicit gridSys: SqGridSys): A

Indexes in to this SqCenOptLayer using the tile centre coordinate, returns the raw value which might be a null.

Indexes in to this SqCenOptLayer using the tile centre coordinate, returns the raw value which might be a null.

Attributes

def applyUnsafe(r: Int, c: Int)(implicit gridSys: SqGridSys): A

Indexes in to this SqCenOptLayer using the tile centre coordinate, returns the raw value which might be a null.

Indexes in to this SqCenOptLayer using the tile centre coordinate, returns the raw value which might be a null.

Attributes

def emptyTile(sc: SqCen)(implicit gridSys: SqGridSys): Boolean

The tile is a None at the given hex grid centre coordinate SqCen.

The tile is a None at the given hex grid centre coordinate SqCen.

Attributes

def keyMap(implicit gridSys: SqGridSys): Map[A, SqCen]
def map[B <: AnyRef](f: A => B)(implicit ct: ClassTag[B]): SqCenOptLayer[B]

Maps this SqCenOptLayer to a new SqCenOptLayer of type B. The None values are just mapped to Nones. The SqGridSys that encodes the layer is not required for this operation.

Maps this SqCenOptLayer to a new SqCenOptLayer of type B. The None values are just mapped to Nones. The SqGridSys that encodes the layer is not required for this operation.

Attributes

def moveUnsafe(s1: SqCen, s2: SqCen)(implicit gridSys: SqGridSys): Unit

Moves the object in the array location given by SqCen1 to SqCen2, by setting s2 to the value of s1 and setting s1 to null.

Moves the object in the array location given by SqCen1 to SqCen2, by setting s2 to the value of s1 and setting s1 to null.

Attributes

def projNoneScPtMap[B, ArrB <: Arr[B]](f: (SqCen, Pt2) => B)(implicit proj: SqSysProjection, build: BuilderArrMap[B, ArrB]): ArrB

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def projNoneScPtMap[B, ArrB <: Arr[B]](proj: SqSysProjection)(f: (SqCen, Pt2) => B)(implicit build: BuilderArrMap[B, ArrB]): ArrB

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def projSomeScPtMap[B, ArrB <: Arr[B]](f: (A, SqCen, Pt2) => B)(implicit proj: SqSysProjection, build: BuilderArrMap[B, ArrB]): ArrB

Drops the None values mapping the Some's value with the SqCen to an option value, collecting the values of the Somes returned by the function. Returns a Seqimut of length 0 to the length of this SqCenOptLayer.

Drops the None values mapping the Some's value with the SqCen to an option value, collecting the values of the Somes returned by the function. Returns a Seqimut of length 0 to the length of this SqCenOptLayer.

Attributes

def projSomeScPtMap[B, ArrB <: Arr[B]](proj: SqSysProjection)(f: (A, SqCen, Pt2) => B)(implicit build: BuilderArrMap[B, ArrB]): ArrB
def scMap[B <: AnyRef](f: (SqCen, A) => B)(implicit ct: ClassTag[B], gridSys: SqGridSys): SqCenOptLayer[B]

Maps the SqCens with the corresponding Some values to a new SqCenOptLayer of type B. The None values are just mapped to Nones.

Maps the SqCens with the corresponding Some values to a new SqCenOptLayer of type B. The None values are just mapped to Nones.

Attributes

def scNoneMap[B, ArrT <: Arr[B]](f: SqCen => B)(implicit gridSys: SqGridSys, build: BuilderArrMap[B, ArrT]): ArrT

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Coordinate map Nones. Map the None values respective SqCen coordinates of this SqCenOptLayer to type B, the first type parameter. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def scSomesFlatMap[ArrB <: Arr[_]](f: (SqCen, A) => ArrB)(implicit gridSys: SqGridSys, build: BuilderArrFlat[ArrB]): ArrB

SqCen with Some flatMap. FlatMaps the Some values of this SqCenArrOpt, with the respective SqCen coordinate to type ArrB. Returns an immutable Array based collection of type ArrB.

SqCen with Some flatMap. FlatMaps the Some values of this SqCenArrOpt, with the respective SqCen coordinate to type ArrB. Returns an immutable Array based collection of type ArrB.

Attributes

def scSomesMap[B, ArrB <: Arr[B]](f: (SqCen, A) => B)(implicit gridSys: SqGridSys, build: BuilderArrMap[B, ArrB]): ArrB

SqCen with Some map. Maps the Some values of this SqCenArrOpt, with the respective SqCen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

SqCen with Some map. Maps the Some values of this SqCenArrOpt, with the respective SqCen coordinate to type B, the first type parameter B. Returns an immutable Array based collection of type ArrT, the second type parameter.

Attributes

def scSomesMapPair[B1, ArrB1 <: Arr[B1], B2, B <: PairFinalA1Elem[B1, B2], ArrB <: PairArrFinalA1[B1, ArrB1, B2, B]](f1: (SqCen, A) => B1)(f2: (SqCen, A) => B2)(implicit gridSys: SqGridSys, build: BuilderArrPairMap[B1, ArrB1, B2, B, ArrB]): ArrB
def setNone(hc: SqCen)(implicit gridSys: SqGridSys): SqCenOptLayer[A]

Creates a new ArrOpt with the specified location set to NoRef.

Creates a new ArrOpt with the specified location set to NoRef.

Attributes

def setNoneMut(hc: SqCen)(implicit gridSys: SqGridSys): Unit

Sets / mutates the value ot the specified location to None.

Sets / mutates the value ot the specified location to None.

Attributes

def setSome(r: Int, c: Int, value: A)(implicit gridSys: SqGridSys): SqCenOptLayer[A]

Creates a new ArrOpt with the specified location set to the specified value.

Creates a new ArrOpt with the specified location set to the specified value.

Attributes

def setSome(sc: SqCen, value: A)(implicit gridSys: SqGridSys): SqCenOptLayer[A]

Creates a new ArrOpt with the specified location set to the specified value.

Creates a new ArrOpt with the specified location set to the specified value.

Attributes

def setSomeMut(r: Int, c: Int, value: A)(implicit gridSys: SqGridSys): Unit

Sets / mutates the Some value of the hex tile data at the specified row and column coordinate values.

Sets / mutates the Some value of the hex tile data at the specified row and column coordinate values.

Attributes

def setSomeMut(hc: SqCen, value: A)(implicit gridSys: SqGridSys): Unit

Sets / the Some value of the hex tile data at the specified SqCen coordinate. This is an imperative mutating operation.

Sets / the Some value of the hex tile data at the specified SqCen coordinate. This is an imperative mutating operation.

Attributes

def some2sMap[B <: AnyRef, C, ArrC <: Arr[C]](optArrB: SqCenOptLayer[B])(f: (A, B) => C)(implicit gridSys: SqGridSys, build: BuilderArrMap[C, ArrC]): ArrC

Maps the Somes of this SqCenArrOpt and the Some values of a second SqCenOptLayer. Returns an immutable Array based collection of type ArrC, the second type parameter.

Maps the Somes of this SqCenArrOpt and the Some values of a second SqCenOptLayer. Returns an immutable Array based collection of type ArrC, the second type parameter.

Attributes

def someSCOptFlatMap[ArrB <: Arr[_]](f: (A, SqCen) => Option[ArrB])(implicit gridSys: SqGridSys, build: BuilderArrFlat[ArrB]): ArrB

Drops the None values, flatMaps the Some's value and the corresponding SqCen to an option of a Arr, collects only the Some's values returned by the function.

Drops the None values, flatMaps the Some's value and the corresponding SqCen to an option of a Arr, collects only the Some's values returned by the function.

Attributes

def someScForeach(f: (SqCen, A) => Unit)(implicit gridSys: SqGridSys): Unit

coordinate-foreach-Some. Foreach Some element and its associated SqCen coordinate applies the side effecting parameter function. It ignores the None values.

coordinate-foreach-Some. Foreach Some element and its associated SqCen coordinate applies the side effecting parameter function. It ignores the None values.

Attributes

def somesForeach(f: A => Unit)(implicit gridSys: SqGridSys): Unit
def somesLen: Int
def somesMap[B, ArrT <: Arr[B]](fSome: A => B)(implicit gridSys: SqGridSys, build: BuilderArrMap[B, ArrT]): ArrT
def somesScForeach(f: (A, SqCen) => Unit)(implicit gridSys: SqGridSys): Unit

Drops the None values. Foreach value of the Some with the corresponding SqCen applies the side effecting parameter function.

Drops the None values. Foreach value of the Some with the corresponding SqCen applies the side effecting parameter function.

Attributes

override def typeStr: String

Attributes

Definition Classes
def unSafeApply(sc: SqCen)(implicit gridSys: SqGridSys): A

Accesses element from Refs Arr. Only use this method where you are certain it is not null, or the consumer can deal with the null.

Accesses element from Refs Arr. Only use this method where you are certain it is not null, or the consumer can deal with the null.

Attributes

def unsafeMove(sc1: SqCen, sc2: SqCen)(implicit gridSys: SqGridSys): Unit

Moves the object in the array location given by the 1st SqCen to the 2nd SqCen, by setting sc2 to the value of sc1 and setting sc1 to None.

Moves the object in the array location given by the 1st SqCen to the 2nd SqCen, by setting sc2 to the value of sc1 and setting sc1 to None.

Attributes

def unsafeSetSome(r: Int, c: Int, value: A)(implicit gridSys: SqGridSys): Unit

Sets the Some value of the square tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Sets the Some value of the square tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Attributes

def unsafeSetSome(sc: SqCen, value: A)(implicit gridSys: SqGridSys): Unit

Sets the Some value of the hex tile data at the specified SqCen coordinate. This is an imperative mutating operation.

Sets the Some value of the hex tile data at the specified SqCen coordinate. This is an imperative mutating operation.

Attributes

def unsafeSetSomes(triples: (Int, Int, A)*)(implicit gridSys: SqGridSys): Unit

Sets the Some values of the hex tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Sets the Some values of the hex tile data at the specified row and column coordinate values. This is an imperative mutating operation.

Attributes

Inherited methods

The length of this tile grid mapped Array of optional values.

The length of this tile grid mapped Array of optional values.

Attributes

Inherited from:
LayerTcOpt
def foldSomes[B](init: B)(f: (B, A) => B): B

Attributes

Inherited from:
LayerTcOpt
def foreach[U](noneValue: => U)(f: A => U): Unit

Attributes

Inherited from:
LayerTcOpt
def mapArr[B, ArrT <: Arr[B]](noneValue: => B)(f: A => B)(implicit build: BuilderArrMap[B, ArrT]): ArrT

Maps the this Arr of Opt values, without their respective Hcen coordinates to an Arr of type B. This method treats the HCenArrOpt class like a standard Arr or Array. It does not utilise the grid TGrid from which this LayerTcOpt was created.

Maps the this Arr of Opt values, without their respective Hcen coordinates to an Arr of type B. This method treats the HCenArrOpt class like a standard Arr or Array. It does not utilise the grid TGrid from which this LayerTcOpt was created.

Attributes

Inherited from:
LayerTcOpt
def mapPairArr[B1, ArrB1 <: Arr[B1], B2, B <: PairFinalA1Elem[B1, B2], ArrB <: PairArrFinalA1[B1, ArrB1, B2, B]](noneB1: => B1, noneB2: => B2)(f1: A => B1)(f2: A => B2)(implicit build: BuilderArrPairMap[B1, ArrB1, B2, B, ArrB]): ArrB

Attributes

Inherited from:
LayerTcOpt
def numSomes: Int

Attributes

Inherited from:
LayerTcOpt
def somesArr[ArrA <: Arr[A]](implicit build: BuilderArrMap[A, ArrA]): ArrA

Returns an ArrBase[A] of type ArrA filtered to the Some values.

Returns an ArrBase[A] of type ArrA filtered to the Some values.

Attributes

Inherited from:
LayerTcOpt
def somesMapArr[B, ArrT <: Arr[B]](f: A => B)(implicit build: BuilderArrMap[B, ArrT]): ArrT

Maps the Some values to type B by the parameter function. It ignores the None values. This method treats the HCenArr class like a standard Arr or Array. It does not utilise the grid TGrid from which this LayerTcOpt was created.

Maps the Some values to type B by the parameter function. It ignores the None values. This method treats the HCenArr class like a standard Arr or Array. It does not utilise the grid TGrid from which this LayerTcOpt was created.

Attributes

Inherited from:
LayerTcOpt

Concrete fields

val arrayUnsafe: Array[A]

The underlying mutable backing Array. it is designated unsafe because it uses nulls for run time efficiency. End users should rarely need to access this directly.

The underlying mutable backing Array. it is designated unsafe because it uses nulls for run time efficiency. End users should rarely need to access this directly.

Attributes