_metadata
Stream Metadata Interface
Metadata is a static knowledge about stream elements to be delivered
Metadata methods can be called many times, they do not trigger any data movements
- Source
- _metadata.scala
Def
Doc Tree description
Doc Tree description
Returns a tree describing all stream trasformations
('a' <> 'z').stream
.map(_.toInt)
.take(_ % 2 == 0)
.docTree.tp
// Output
scalqa.lang.int.g.Stream$TakeStream$2@4ds1{raw=Int}
scalqa.lang.char.z.stream.map$Ints@j38c{raw=Int,fromRaw=Char,size=26}
scalqa.lang.char.Z$Stream_fromRange@gw1k{raw=Char,size=26,from=a,step=1}
- Source
- _metadata.scala
Optional long size
Optional long size
Many streams can return their current element count. If the information is not available, void option is returned
var s = (Int.min.Long <> Int.max.toLong).stream
s.sizeLongOpt.tp // Prints Long.Opt(4294967296)
s = s.take(_ > 10) // static sizing is lost
s.sizeLongOpt.tp // Prints Long.Opt(VOID)
- Source
- _metadata.scala
Optional size
Optional size
Many streams can return their current element count. If the information is not available, void option is returned
Note: If size is known, but exceeds integer range, void option is returned. For theses cases use sizeLongOpt
var s = ('a' <> 'z').stream
s.sizeOpt.tp // Prints Int.Opt(26)
s = s.take(_ > 10) // static sizing is lost
s.sizeOpt.tp // Prints Int.Opt(VOID)
- Source
- _metadata.scala