LayerHcOptSys

ostrat.prid.phex.LayerHcOptSys
See theLayerHcOptSys companion object
final class LayerHcOptSys[A <: AnyRef](val arrayUnsafe: Array[A]) extends AnyVal, LayerHcOpt[A], LayerHcSys[Option[A]]

A HGridSys data layer of optional tile data. This is specialised for OptRef[A]. The tileGrid can map the HCen coordinate of the tile to the index of the Arr. Hence most methods take an implicit HGridSys hex grid parameter.

Attributes

Companion
object
Graph
Supertypes
trait LayerHcSys[Option[A]]
trait LayerHcOpt[A]
trait LayerTcOpt[A]
class AnyVal
trait Matchable
class Any
Show all

Members list

Type members

Types

override type KeyT = HGridSys
override type ThisT = LayerHcOptSys[A]

Value members

Concrete methods

def MoveModifyMut(hc1: HCen, hc2: HCen)(f: A => A)(implicit gridSys: HGridSys): Unit

Not sure if this is still needed.

Not sure if this is still needed.

Attributes

def apply(hc: HCen)(implicit gridSys: HGridSys): Option[A]

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

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

Attributes

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

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

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

Attributes

def applyUnsafe(hc: HCen)(implicit gridSys: HGridSys): A

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

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

Attributes

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

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

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

Attributes

Creates a shallow copy of this LayerHcOptSys.

Creates a shallow copy of this LayerHcOptSys.

Attributes

def emptyTile(hc: HCen)(implicit gridSys: HGridSys): Boolean

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

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

Attributes

def find(value: A)(implicit gridSys: HGridSys): Option[HCen]

Optionally finds the value returning the HCen location wrapped in a Some if found.

Optionally finds the value returning the HCen location wrapped in a Some if found.

Attributes

def findHCen(value: A)(implicit gridSys: HGridSys): Option[HCen]
def getex(r: Int, c: Int)(implicit gridSys: HGridSys): A

Indexes in to this LayerHcOptSys using the tile centre coordinate, will return nulls for None values, throws exception if tile centre does not exist.

Indexes in to this LayerHcOptSys using the tile centre coordinate, will return nulls for None values, throws exception if tile centre does not exist.

Attributes

def getex(hc: HCen)(implicit gridSys: HGridSys): 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 hcMap[B <: AnyRef](f: (HCen, A) => B)(implicit ct: ClassTag[B], gridSys: HGridSys): LayerHcOptSys[B]

Maps the corresponding HCens with the Some values to a new LayerHcOptSys to a new LayerHcOptSys of type B. None values are just mapped to Nones.

Maps the corresponding HCens with the Some values to a new LayerHcOptSys to a new LayerHcOptSys of type B. None values are just mapped to Nones.

Attributes

def hcMapArr[B, ArrT <: Arr[B]](fNone: => HCen => B)(fSome: (A, HCen) => B)(implicit gridSys: HGridSys, build: BuilderArrMap[B, ArrT]): ArrT

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Attributes

def indexMap[B <: AnyRef](f: (Int, A) => B)(implicit ct: ClassTag[B], gridSys: HGridSys): LayerHcOptSys[B]

Not sure what this does could perhaps be deleted.

Not sure what this does could perhaps be deleted.

Attributes

def map[B <: AnyRef](f: A => B)(implicit ct: ClassTag[B]): LayerHcOptSys[B]

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

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

Attributes

def moveUnsafe(hc1: HCen, hc2: HCen)(implicit gridSys: HGridSys): Unit

Moves the object in the array location given by the 1st HCen to the 2nd HCen, by setting hc2 to the value of hc1 and setting hc1 to None. This mutates the data layer.

Moves the object in the array location given by the 1st HCen to the 2nd HCen, by setting hc2 to the value of hc1 and setting hc1 to None. This mutates the data layer.

Attributes

def noneHCMap[B, ArrB <: Arr[B]](f: HCen => B)(implicit gridSys: HGridSys, build: BuilderArrMap[B, ArrB]): ArrB

Drops the Some values. Maps the corresponding HCen for the None to type B. Returns a Arr of length between 0 and the length of this LayerHcOptSys.

Drops the Some values. Maps the corresponding HCen for the None to type B. Returns a Arr of length between 0 and the length of this LayerHcOptSys.

Attributes

def out(gridSys: HGridSys)(implicit showA: Show[A]): String
def projHcMap(proj: HSysProjection)(fNone: (Pt2, HCen) => GraphicElem)(fSome: (A, Pt2, HCen) => GraphicElem): GraphicElems

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Maps the option values with the corresponding HCen to type B. Hence it takes two functions as parameters one for the None values and one for the Some values.

Attributes

def projNoneHcPtMap[B, ArrB <: Arr[B]](f: (HCen, Pt2) => B)(implicit proj: HSysProjection, build: BuilderArrMap[B, ArrB]): ArrB

Uses a projection of the implicit HGridSys to map the HCen and the Pt2 from the projection where this LayerHcOptSys contains None values. There is a name overload for this where the projection is passed explicitly as the first parameter list.

Uses a projection of the implicit HGridSys to map the HCen and the Pt2 from the projection where this LayerHcOptSys contains None values. There is a name overload for this where the projection is passed explicitly as the first parameter list.

Attributes

def projNoneHcPtMap[B, ArrB <: Arr[B]](proj: HSysProjection)(f: (HCen, Pt2) => B)(implicit build: BuilderArrMap[B, ArrB]): ArrB

Uses a projection of the implicit HGridSys to map the HCen and the Pt2 from the projection where this LayerHcOptSys contains None values. There is a name overload for this where the projection is passed implicitly with the BuilderArrMap.

Uses a projection of the implicit HGridSys to map the HCen and the Pt2 from the projection where this LayerHcOptSys contains None values. There is a name overload for this where the projection is passed implicitly with the BuilderArrMap.

Attributes

def projSomeHCMap(f: (A, HCen) => GraphicElem)(implicit proj: HSysProjection): GraphicElems

Drops the None values mapping the Some's value with the HCen 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 LayerHcOptSys.

Drops the None values mapping the Some's value with the HCen 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 LayerHcOptSys.

Attributes

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

def projSomesHcPtMap[B, ArrB <: Arr[B]](f: (A, HCen, Pt2) => B)(implicit proj: HSysProjection, build: BuilderArrMap[B, ArrB]): ArrB

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

def projSomesHcPtMap[B, ArrB <: Arr[B]](proj: HSysProjection)(f: (A, HCen, Pt2) => B)(implicit build: BuilderArrMap[B, ArrB]): ArrB

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the corresponding HCen and the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

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

Uses projection to map the Some data value with the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

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

Uses projection to map the Some data value with the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Uses projection to map the Some data value with the projections corresponding Pt2 to an element of type B. In most cases B will be a GraphicElem or a subtype.

Attributes

def setAllMut(value: A): Unit

Sets / mutates every element to the given value.

Sets / mutates every element to the given value.

Attributes

def setFSomesMut(f: () => A, hCens: Int*)(implicit gridSys: HGridSys): Unit

Sets multiple HCen locations to Some values.

Sets multiple HCen locations to Some values.

Attributes

def setNone(hc: HCen)(implicit gridSys: HGridSys): LayerHcOptSys[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: HCen)(implicit gridSys: HGridSys): Unit

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

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

Attributes

def setSamesUnsafe(value: A, hCens: Int*)(implicit gridSys: HGridSys): Unit

Sets / mutates the given hex tiles to the given value.

Sets / mutates the given hex tiles to the given value.

Attributes

def setSome(r: Int, c: Int, value: A)(implicit gridSys: HGridSys): LayerHcOptSys[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(hc: HCen, value: A)(implicit gridSys: HGridSys): LayerHcOptSys[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: HGridSys): 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: HCen, value: A)(implicit gridSys: HGridSys): Unit

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

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

Attributes

def setSomesMut(triples: (Int, Int, A)*)(implicit gridSys: HGridSys): Unit

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

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

Attributes

def someHCMapArr[B, ArrB <: Arr[B]](f: (A, HCen) => B)(implicit gridSys: HGridSys, build: BuilderArrMap[B, ArrB]): ArrB

Drops the None values. Maps the Some's value with the corresponding HCen to value of type B. Returns a Seqimut of length between 0 and the length of this LayerHcOptSys.

Drops the None values. Maps the Some's value with the corresponding HCen to value of type B. Returns a Seqimut of length between 0 and the length of this LayerHcOptSys.

Attributes

def someHCOptFlatMap[ArrB <: Arr[_]](f: (A, HCen) => Option[ArrB])(implicit gridSys: HGridSys, build: BuilderArrFlat[ArrB]): ArrB

Drops the None values, flatMaps the Some's value and the corresponding HCen 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 HCen to an option of a Arr, collects only the Some's values returned by the function.

Attributes

def somePairs(implicit gridSys: HGridSys, build: HCenPairArrMapBuilder[A]): HCenPairArr[A]

Returns an HCenPairArr of the Some values.

Returns an HCenPairArr of the Some values.

Attributes

def somesHcFlatMap[ArrT <: Arr[_]](f: (A, HCen) => ArrT)(implicit gridSys: HGridSys, build: BuilderArrFlat[ArrT]): ArrT

FlatMaps the value of the Some with the corresponding HCen to a Arr. Drops the None values .

FlatMaps the value of the Some with the corresponding HCen to a Arr. Drops the None values .

Attributes

def somesHcForeach(f: (A, HCen) => Unit)(implicit gridSys: HGridSys): Unit

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

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

Attributes

def somesHcMap[B, ArrT <: Arr[B]](f: (A, HCen) => B)(implicit gridSys: HGridSys, build: BuilderArrMap[B, ArrT]): ArrT

Maps the Some values with the corresponding HCen to type B. The None values are dropped.

Maps the Some values with the corresponding HCen to type B. The None values are dropped.

Attributes

def somesHcPairMap[B1, B1Arr <: Arr[B1], B2, B <: PairElem[B1, B2], ArrT <: ArrPair[B1, B1Arr, B2, B]](f: (A, HCen) => B)(implicit gridSys: HGridSys, build: BuilderArrPairMap[B1, B1Arr, B2, B, ArrT]): ArrT

Maps the Some values with the corresponding HCen to type B. The None values are dropped.

Maps the Some values with the corresponding HCen to type B. The None values are dropped.

Attributes

def somesMap[B, ArrT <: Arr[B]](fSome: A => B)(implicit gridSys: HGridSys, build: BuilderArrMap[B, ArrT]): ArrT

Maps from the Some values to an Arr.

Maps from the Some values to an Arr.

Attributes

override def typeStr: String

Attributes

Definition Classes
def zipSomesHCMap[B <: AnyRef, C, ArrC <: Arr[C]](optArrB: LayerHcOptSys[B])(f: (A, B, HCen) => C)(implicit gridSys: HGridSys, build: BuilderArrMap[C, ArrC]): ArrC

Uses this and a second LayerHcOptSys of type B, combining corresponding pairs of Some values with the corresponding HCen and apping to a value of type C. Returns a Arr with a length between 0 and the length of the original HCenOptDGtid data grids.

Uses this and a second LayerHcOptSys of type B, combining corresponding pairs of Some values with the corresponding HCen and apping to a value of type C. Returns a Arr with a length between 0 and the length of the original HCenOptDGtid data grids.

Attributes

def zipSomesMap[B <: AnyRef, C, ArrC <: Arr[C]](optArrB: LayerHcOptSys[B])(f: (A, B) => C)(implicit gridSys: HGridSys, build: BuilderArrMap[C, ArrC]): ArrC

Uses this and a second LayerHcOptSys of type B. Drops all values where either or both LayerHcOptSys have None values. Maps the corresponding values of the Somes to type C. Returns a Arr of length bwteen 0 na d the length of the original LayerHcOptSyss.

Uses this and a second LayerHcOptSys of type B. Drops all values where either or both LayerHcOptSys have None values. Maps the corresponding values of the Somes to type C. Returns a Arr of length bwteen 0 na d the length of the original LayerHcOptSyss.

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 outt(implicit gridSys: HGridSys, evAA: Show[Option[A]]): String

Attributes

Inherited from:
LayerHcSys
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