Val
Value Container Framework
Read more in the Guide.
Val is fully exported to scalqa root, thus all members of Val can be called with or without "Val." prefix.
For example:
val v: Val.Stream[Int] = ???
// is same as
val v: Stream[Int] = ???
- Source
- __.scala
Member
Value Buffer
Buffer is the default implementation of Mutable Indexed Collection
Buffer is an abstract class with concrete implementations: AnyRef.G.Buffer, Byte.G.Buffer, Int.G.Buffer, etc.
- Source
- __.scala
Value Buffer
Buffer is the default implementation of Mutable Indexed Collection
Buffer is an abstract class with concrete implementations: AnyRef.G.Buffer, Byte.G.Buffer, Int.G.Buffer, etc.
- Source
- __.scala
- Source
- __.scala
- Source
- __.scala
Indexed Collection
Elements in Idx can be efficiently accessed with Int index starting from 0
- Source
- __.scala
Indexed Collection
Elements in Idx can be efficiently accessed with Int index starting from 0
- Source
- __.scala
Lookup Collection
In Lookup collection every element is stored with a 'key' and can be accessed (looked up) with this 'key'
It is a greatly simplified equivalent of scala.Map
- Source
- __.scala
Lookup Collection
In Lookup collection every element is stored with a 'key' and can be accessed (looked up) with this 'key'
It is a greatly simplified equivalent of scala.Map
- Source
- __.scala
Value Option
Opt is a container, which can hold a single value or be empty
Option can be converted to value with method or
, which also takes default value for the case when option is empty
Option is often used as Boolean, where ''Option'' with value is converted to 'true' and empty option is converted to 'false'
val l: Lookup[Int,String] = ???
val o: Opt[String] = l.getOpt(12)
if(o) println("Value found.")
else println("Value not found.")
- Source
- __.scala
Value Pack
Pack is the most ubiquitous immutable collection, like List in Scala
Unlike List, Pack is mostly backed by an Array and can be specialized. It usually has smaller memory footprint and in most cases is faster to manipulate data.
- Source
- __.scala
Value Pack
Pack is the most ubiquitous immutable collection, like List in Scala
Unlike List, Pack is mostly backed by an Array and can be specialized. It usually has smaller memory footprint and in most cases is faster to manipulate data.
- Source
- __.scala
Value Provider
Whenever value provider belongs to an object, it effectively becomes a property holder for this object.
Properties Framework
There are 4 types of standard properties:
- Pro - read only
- Pro.Mutable - read/write, aliased as Pro.M
- Pro.Observable - read/listenTo, aliased as Pro.O
- Pro.ObservableMutable - read/write/listenTo, aliased as Pro.OM
The inheritance graph looks like:
Pro.O
/ \
Pro Pro.OM
\ /
Pro.M
Here is an example of 'name' property definition hierarchy:
trait Foo: // 'name' is read only
def namePro : Pro[String]
def name : String = namePro() // required shortcut
trait Foo_M extends Foo: // 'name' is read/write
def namePro : Pro.M[String]
def name_=(v:String) : Unit = namePro() = v // required shortcut
trait Foo_O extends Foo: // 'name' is read/listenTo
def namePro : Pro.O[String]
trait Foo_OM extends Foo_O with Foo_M: // 'name' is read/write/listenTo
def namePro : Pro.OM[String]
Note. The 'required shortcuts' must be implemented. They will not even show up in documentation, because they are assumed to be there
- Source
- __.scala
Value Provider
Whenever value provider belongs to an object, it effectively becomes a property holder for this object.
Properties Framework
There are 4 types of standard properties:
- Pro - read only
- Pro.Mutable - read/write, aliased as Pro.M
- Pro.Observable - read/listenTo, aliased as Pro.O
- Pro.ObservableMutable - read/write/listenTo, aliased as Pro.OM
The inheritance graph looks like:
Pro.O
/ \
Pro Pro.OM
\ /
Pro.M
Here is an example of 'name' property definition hierarchy:
trait Foo: // 'name' is read only
def namePro : Pro[String]
def name : String = namePro() // required shortcut
trait Foo_M extends Foo: // 'name' is read/write
def namePro : Pro.M[String]
def name_=(v:String) : Unit = namePro() = v // required shortcut
trait Foo_O extends Foo: // 'name' is read/listenTo
def namePro : Pro.O[String]
trait Foo_OM extends Foo_O with Foo_M: // 'name' is read/write/listenTo
def namePro : Pro.OM[String]
Note. The 'required shortcuts' must be implemented. They will not even show up in documentation, because they are assumed to be there
- Source
- __.scala
Value Promise
Promise represents value which will be available later (at some point of time), but it can now be incorporated in current calculations
val s: String = "Hello"
val v: Promise[String] = Promise(s + " Concurrent Promise!")
v.resultOpt.tp // Value is likely not available yet
v.onResult(_.tp) // Will run when value is available
// Output
Opt(VOID)
Result(Hello Concurrent Promise!)
- Source
- __.scala
Value Promise
Promise represents value which will be available later (at some point of time), but it can now be incorporated in current calculations
val s: String = "Hello"
val v: Promise[String] = Promise(s + " Concurrent Promise!")
v.resultOpt.tp // Value is likely not available yet
v.onResult(_.tp) // Will run when value is available
// Output
Opt(VOID)
Result(Hello Concurrent Promise!)
- Source
- __.scala
Value Range
Range is logically defined with the following defs:
start
end
,- and
ordering
, which makes the above meaningful
Range has a notion that an element can be within the range, i.e. between start and end, or outside
Note. Scala provided range structures (scala.collection.immutable.Range and scala.collection.immutable.NumericRange) are implemented more as collections and this class is designed to close this void focusing on basic range features.
- Source
- __.scala
Value Range
Range is logically defined with the following defs:
start
end
,- and
ordering
, which makes the above meaningful
Range has a notion that an element can be within the range, i.e. between start and end, or outside
Note. Scala provided range structures (scala.collection.immutable.Range and scala.collection.immutable.NumericRange) are implemented more as collections and this class is designed to close this void focusing on basic range features.
- Source
- __.scala
Value Result
Result is a container, which holds either 'value' or 'problem', which explains why value is not available.
Unlike Opt, Result is never void, even if there is no value, then, there must be a problem.
val r1: Result[Int] = "123".toIntResult
r1.tp // Prints Result(123)
val r2: Result[Int] = "ABC".toIntResult
r2.tp // Prints Result(Problem(For input string: "ABC"))
- Source
- __.scala
Set is an immutable collection with no duplicate values
When an element is joined to a Set, it is evaluated for uniqueness and the operation is ignored in case of duplicates.
Note: Set is a concrete single implementation of unique collection. There is no general "Set" interface, because its use is rare. If there is a need for more efficient "Set" functionality, create one with Collection.Mutable.noDuplicates. The result is faster, but is not thread safe.
- Source
- __.scala
Set is an immutable collection with no duplicate values
When an element is joined to a Set, it is evaluated for uniqueness and the operation is ignored in case of duplicates.
Note: Set is a concrete single implementation of unique collection. There is no general "Set" interface, because its use is rare. If there is a need for more efficient "Set" functionality, create one with Collection.Mutable.noDuplicates. The result is faster, but is not thread safe.
- Source
- __.scala
Value Stream
Read about Stream in the Guide.
Stream has just one method to be implemented, but it has large attached libraries for:
- Source
- __.scala
Value Stream
Read about Stream in the Guide.
Stream has just one method to be implemented, but it has large attached libraries for:
- Source
- __.scala