Class ReadOnlyListTokenStream<TToken>
An ITokenStream<TToken> implementation based on an IReadOnlyList<T>.
Inheritance
- object
- ReadOnlyListTokenStream<TToken>
Implements
- ITokenStream<TToken>
Inherited Members
- object.GetType()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()
Declaration
public sealed class ReadOnlyListTokenStream<TToken> : ITokenStream<TToken>
Type Parameters
Name | Description |
---|---|
TToken |
The type of tokens in the list. |
Constructors
ReadOnlyListTokenStream(IReadOnlyList<TToken>)
Creates an ITokenStream<TToken> implementation based on an IReadOnlyList<T>.
Declaration
public ReadOnlyListTokenStream(IReadOnlyList<TToken> input)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<TToken> |
input |
The IReadOnlyList<T>. |
Properties
ChunkSizeHint
Returns 16.
Declaration
public int ChunkSizeHint { get; }
Property Value
Type | Description |
---|---|
Methods
Read(Span<TToken>)
Read up to buffer.Length
tokens into buffer
.
Return the actual number of tokens read, which may be fewer than
the size of the buffer if the stream has reached the end.
Declaration
public int Read(Span<TToken> buffer)
Parameters
Type | Name | Description |
---|---|---|
Span<TToken> |
buffer |
The buffer to read tokens into. |
Returns
Type | Description |
---|---|
The actual number of tokens read. |