const classafConcurrent::LocalList
sys::Obj afConcurrent::LocalList
Manages a List stored in Actor.locals
with a unique key.
Note that LocalLists
are lazy; that is, no List is created or stored in Actor.locals
until accessed.
- add
Add the specified item to the end of the list. Return this.
- clear
This clear()
Remove all key/value pairs from the map. Return this.
- contains
Returns
true
if this list contains the specified item.- each
Call the specified function for every item in the list.
- first
Obj? first()
Return the item at index 0, or if empty return null.
- get
Returns the item at the specified index. A negative index may be used to access an index from the end of the list.
- insert
This insert(Int index, Obj? item)
Insert the item at the specified index. A negative index may be used to access an index from the end of the list. Size is incremented by 1. Return this. Throw IndexErr if index is out of range. Throw ReadonlyErr if readonly.
- isEmpty
Bool isEmpty()
Return
true
if size() == 0- last
Obj? last()
Return the item at index-1, or if empty return null.
- localRef
const LocalRef localRef
The
LocalRef
thisLocalList
wraps.- make
new make(Str name := "LocalList", |This? f := null)
Makes a
LocalList
instance.name
is passed toLocalList
.- peek
Obj? peek()
- pop
Obj? pop()
- push
- remove
Removes the specified item from the list, returning the removed item. If the item was not mapped then return
null
.- removeAt
Remove the object at the specified index. A negative index may be used to access an index from the end of the list. Return the item removed.
- size
Int size()
Get the number of values in the map.
- toStr
virtual override Str toStr()
Returns a string representation the list.
- val
Obj?[] val
Gets or sets the thread local list
- valType
const Type valType := sys::Obj?#
Used to parameterize the backing list.
LocalList("name") { it.valType = Str# }