Table of Contents

Struct WindowSequence.Window<T>

Namespace
PatternKit.Behavioral.Iterator
Assembly
PatternKit.Core.dll

Represents a fixed-size (or trailing partial) window of elements.

public readonly struct WindowSequence.Window<T>

Type Parameters

T

Element type.

Inherited Members

Properties

Count

Number of meaningful elements in the window.

public int Count { get; }

Property Value

int

IsBufferReused

True when the underlying buffer is reused across windows (caller must copy).

public bool IsBufferReused { get; }

Property Value

bool

IsPartial

True when this is a trailing partial (smaller than requested size).

public bool IsPartial { get; }

Property Value

bool

this[int]

Indexed element access (0-based).

public T this[int index] { get; }

Parameters

index int

Property Value

T

Methods

GetEnumerator()

Enumerates the elements in this window (snapshot view—may reflect later changes if buffer is reused).

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

ToArray()

Materializes the window as a fresh array (always copies to guarantee immutability even when buffer reused).

public T[] ToArray()

Returns

T[]