TreeList

public struct TreeList<Value>
extension TreeList: ExpressibleByArrayLiteral
extension TreeList: MutableCollection, BidirectionalCollection
extension TreeList: Equatable where Value: Equatable
extension TreeList: Hashable where Value: Hashable
extension TreeList: CustomStringConvertible where Value: CustomStringConvertible

Undocumented

compactMap

  • Undocumented

    Declaration

    Swift

    public func compactMapValues<NewValue>(_ transform: (Value) -> NewValue?) -> TreeList<NewValue>

filter

  • Undocumented

    Declaration

    Swift

    public func filterValues(_ isIncluded: (Value) -> Bool) -> TreeList<Value>

Move

  • Undocumented

    Declaration

    Swift

    public mutating func removeAll(where shouldBeRemoved: (TreeNode<Value>) -> Bool)

Available where Value: CustomStringConvertible

  • Declaration

    Swift

    public var description: String { get }

Available where Value: Hashable

  • Moves the TreeNodes at the given sourceIndices to insertIndex. The sourceIndices and insertIndex are both specified in the before state of the tree. If elements are removed before the insertIndex, the insertIndex will be adjusted.

    The move operation will fail and return nil, if the insertIndex is a child of one of the moved TreeNodes.

    Declaration

    Swift

    public func move(indices sourceIndices: [TreeIndex], to insertIndex: TreeIndex) -> TreeList<Value>?

    Parameters

    sourceIndices

    the indices of the elements that should be moved

    insertIndex

    the insertion index to move the elements to

    Return Value

    A new Tree with the specified changes or nil if the the move was not possible

  • Undocumented

    Declaration

    Swift

    public func difference(from old: `Self`) -> TreeDifference<Value>
  • Undocumented

    Declaration

    Swift

    public func applying(_ diff: TreeDifference<Value>) -> `Self`?