<commit_before>/**
	Copyright (C) 2017 <NAME>

	Date:  July 2017
	License:  MIT
 */

import Foundation
import Tapestry

public protocol CreatableElement {
	init()
}

open class CollectionViewpoint<T: CreatableElement>: Presentation {

	open var presentations: [Presentation] { return [] }
	/// The presented collection.
    open var collection: Array<T>
	public var changed = true
	/// The indexes corresponding to inserted and updated items since the last UI update.
	///
	/// Calling `remove()` or `remove(at:)` result in indexes being removed and successors shifted towards the
	/// first index.
	///
	/// These indexes are relative to `itemPresentingCollection(from:)`.
    var changedIndexes = IndexSet() {
		didSet {
			changed = !changedIndexes.isEmpty || changed<commit_msg>Improved doc about changed indexes a little a bit<commit_after>/**
	Copyright (C) 2017 <NAME>

	Date:  July 2017
	License:  MIT
 */

import Foundation
import Tapestry

public protocol CreatableElement {
	init()
}

open class CollectionViewpoint<T: CreatableElement>: Presentation {

	open var presentations: [Presentation] { return [] }
	/// The presented collection.
    ///
    /// When a new collection is assigned, selection and changed indexes must be manually updated.
    /// Once a viewpoint has been created, assigning a new  collection should usually be avoided.
    open var collection: Array<T>
	public var changed = true
	/// The indexes corresponding to inserted and updated items since the last UI update.
	///
	/// Calling `remove()` or `remove(at:)` result in indexes being removed and successors shifted
    /// towards the first index.
	///
	/// These indexes are relative to `itemPresentingCollection(from:)`.
    var changedIndexes = IndexSet() {
		didSet {
			changed = !changedIndexes.isEmpty || changed
{'fraction_non_alphanumeric': 0.09900442477876106, 'fraction_numerical': 0.008849557522123894, 'mean_word_length': 3.626598465473146, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3499863', 'n_tokens_mistral': 521, 'n_tokens_neox': 473, 'n_words': 197}