Skip to content
FutureBlitz

    Install

    Import std.collections.view

    std.collections.view

    Views that don't copy what they show: part of an array, which reads and sets it in place, and an array, Map, or Set to read but not change, to hand out. Each keeps what it shows alive and sees its changes. A slice, items[a..b], is still a copy.

    std/collections/view.fb

    Types

    ArrayView class

    @DebugElements Public Class ArrayView<T> Implements Iterable<T>

    Part of an array, whose elements it reads and sets in place, counting from its own start. Its Count is the part's own, which stays as the array changes, and an element the array no longer has panics.

    std/collections/view.fb, line 40

    • Public Property Count: Int property #

      How many elements it shows.

    • @PanicsAtCaller Operator [](index: Int): T operator #

      The element at index, from 0 to Count minus 1.

    • @PanicsAtCaller Operator []=(index: Int, value: T) operator #

      Gives the element at index, from 0 to Count minus 1, a new value, in the array.

    • @PanicsAtCaller Public Method View(start: Int, finish: Int): ArrayView<T> method #

      Part of this view, from start up to finish, without the one at finish.

    • @PanicsAtCaller Public Method ToArray(): T[] method #

      The elements, in a new array.

    • Public Method Iterate(): ArrayViewIterator<T> method #

      The elements, in order.

    ArrayViewIterator struct

    Public Struct ArrayViewIterator<T> Implements Iterator<T>

    The elements of an ArrayView, in order, which For ... In goes over.

    std/collections/view.fb, line 110

    ReadOnlyArray class

    @DebugElements Public Class ReadOnlyArray<T> Implements Iterable<T>

    An array to read but not change, which AsReadOnly gives.

    std/collections/view.fb, line 123

    • Public Property Count: Int property #

      How many elements it holds.

    • @PanicsAtCaller Operator [](index: Int): T operator #

      The value at index, which panics outside it.

    • Public Method Contains(value: T): Bool method #

      Whether it holds value.

    • Public Method ToArray(): T[] method #

      The elements, in a new array, which can change.

    • Public Method Iterate(): ArrayIterator<T> method #

      Its values, from the first, in an Iterator of their own.

      Doc from std.core.iterator.Iterable.Iterate.

    ReadOnlyMap class

    @DebugEntries Public Class ReadOnlyMap<K: Hashable, V> Implements Iterable<(K, V)>

    A Map to read but not change, which AsReadOnly gives.

    std/collections/view.fb, line 153

    • Public Property Count: Int property #

      How many entries it holds.

    • @PanicsAtCaller Operator [](key: K): V operator #

      The key's value, or the Map's default when it isn't there, or a panic when it has none.

    • Public Method Get(key: K): V? method #

      The value of key, or Null when it has none.

    • Public Method Get(key: K, fallback: V): V method #

      The value of key, or fallback when it has none.

    • Public Method Contains(key: K): Bool method #

      Whether key has an entry.

    • Public Method Keys(): K[] method #

      Its keys, in order, in a new array.

    • Public Method Values(): V[] method #

      Its values, in order, in a new array.

    • Public Method ToMap(): Map<K, V> method #

      The entries, in a new Map, which can change.

    • Public Method Iterate(): MapIterator<K, V> method #

      Its values, from the first, in an Iterator of their own.

      Doc from std.core.iterator.Iterable.Iterate.

    ReadOnlySet class

    @DebugElements Public Class ReadOnlySet<T: Hashable> Implements Iterable<T>

    A Set to read but not change, which AsReadOnly gives.

    std/collections/view.fb, line 192

    • Public Property Count: Int property #

      How many values it holds.

    • Public Method Contains(value: T): Bool method #

      Whether it holds value.

    • Public Method ToArray(): T[] method #

      The values, in a new array.

    • Public Method ToSet(): Set<T> method #

      The values, in a new Set, which can change.

    • Public Method Iterate(): SetIterator<T> method #

      Its values, from the first, in an Iterator of their own.

      Doc from std.core.iterator.Iterable.Iterate.

    Extends

    T[] extend

    Extend T[]

    No doc comment.

    std/collections/view.fb, line 10

    • @PanicsAtCaller Public Method View(start: Int, finish: Int): ArrayView<T> method #

      The elements from start up to finish, without the one at finish, as a view of them in the array. They have to be in the array.

    • Public Method AsReadOnly(): ReadOnlyArray<T> method #

      The array, to read but not change.

    Map extend

    Extend Map<K, V>

    No doc comment.

    std/collections/view.fb, line 27

    • Public Method AsReadOnly(): ReadOnlyMap<K, V> method #

      The Map, to read but not change.

    Set extend

    Extend Set<T>

    No doc comment.

    std/collections/view.fb, line 32

    • Public Method AsReadOnly(): ReadOnlySet<T> method #

      The Set, to read but not change.

    ArrayView extend

    Extend ArrayView<T> Implements Printable

    No doc comment.

    std/collections/view.fb, line 218

    ReadOnlyArray extend

    Extend ReadOnlyArray<T> Implements Printable

    No doc comment.

    std/collections/view.fb, line 225

    ReadOnlyMap extend

    Extend ReadOnlyMap<K, V> Implements Printable

    No doc comment.

    std/collections/view.fb, line 231

    ReadOnlySet extend

    Extend ReadOnlySet<T> Implements Printable

    No doc comment.

    std/collections/view.fb, line 238

    Report an issue with this page or with FutureBlitz on GitHub.