Table of Contents

Class IntegerPattern

Namespace
CilFi.Patterns
Assembly
CilFi.Core.dll

Defines the pattern matching on integer-like values.

public record IntegerPattern : Pattern<object?>, IEquatable<Pattern>, IEquatable<Pattern<object?>>, IEquatable<IntegerPattern>
Inheritance
IntegerPattern
Implements
Inherited Members

Constructors

IntegerPattern(IntegerPattern)

protected IntegerPattern(IntegerPattern original)

Parameters

original IntegerPattern

IntegerPattern(Pattern<long>)

Defines the pattern matching on integer-like values.

public IntegerPattern(Pattern<long> Number)

Parameters

Number Pattern<long>

The pattern describing the expected integer.

IntegerPattern(long)

Constructs an integer pattern.

public IntegerPattern(long number)

Parameters

number long

The expected value.

Fields

AnyInteger

Defines the pattern for any integer.

public static readonly Pattern<object?> AnyInteger

Field Value

Pattern<object>

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Number

The pattern describing the expected integer.

public Pattern<long> Number { get; init; }

Property Value

Pattern<long>

Methods

Deconstruct(out Pattern<long>)

public void Deconstruct(out Pattern<long> Number)

Parameters

Number Pattern<long>

Equals(IntegerPattern?)

public virtual bool Equals(IntegerPattern? other)

Parameters

other IntegerPattern

Returns

bool

Equals(Pattern<object?>?)

public override sealed bool Equals(Pattern<object?>? other)

Parameters

other Pattern<object>

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Format(IndentedTextWriter)

Serializes the pattern to a readable string.

public override void Format(IndentedTextWriter writer)

Parameters

writer IndentedTextWriter

The output stream.

GetHashCode()

public override int GetHashCode()

Returns

int

Match(object?, MatchingContext)

Attempts to match the provided input to the pattern.

public override IMatchNode<object?>? Match(object? input, MatchingContext context)

Parameters

input object

The input to match.

context MatchingContext

The context in which to match the pattern to.

Returns

IMatchNode<object>

When successful, returns the root node of the match tree, otherwise null.

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

Operators

operator ==(IntegerPattern?, IntegerPattern?)

public static bool operator ==(IntegerPattern? left, IntegerPattern? right)

Parameters

left IntegerPattern
right IntegerPattern

Returns

bool

operator !=(IntegerPattern?, IntegerPattern?)

public static bool operator !=(IntegerPattern? left, IntegerPattern? right)

Parameters

left IntegerPattern
right IntegerPattern

Returns

bool