expression

< Back


NextWeekDay

Namespace: Albatross.Expression.Prefix

Prefix expression that finds the next weekday (Monday-Friday) from a given date. Takes 1-2 parameters: the starting date and optional number of weekdays to advance (defaults to 1).

public class NextWeekDay : PrefixExpression, Albatross.Expression.Nodes.IPrefixExpression, Albatross.Expression.Nodes.IExpression, Albatross.Expression.Nodes.IToken

Inheritance ObjectPrefixExpressionNextWeekDay
Implements IPrefixExpression, IExpression, IToken

Properties

Name

The name of the prefix function.

public string Name { get; }

Property Value

String

Token

The token representation, which is the same as the Name.

public string Token { get; }

Property Value

String

MinOperandCount

The minimum number of operands this function requires.

public int MinOperandCount { get; }

Property Value

Int32

MaxOperandCount

The maximum number of operands this function accepts.

public int MaxOperandCount { get; }

Property Value

Int32

Operands

The list of operand expressions passed to this function.

public IReadOnlyList<IExpression> Operands { get; set; }

Property Value

IReadOnlyList<IExpression>

Constructors

NextWeekDay()

Initializes a new instance of the NextWeekDay class with name “NextWeekDay” and 1-2 parameters.

public NextWeekDay()

Methods

Run(List<Object>)

Finds the next weekday by advancing the specified number of weekdays from the given date. Skips weekends (Saturday and Sunday) and returns the next business day.

protected object Run(List<object> operands)

Parameters

operands List<Object>
List containing 1-2 operands: starting date and optional weekday count (defaults to 1).

Returns

Object
A DateTime representing the next weekday after advancing the specified count.

Exceptions

!:FormatException
Thrown when operands cannot be converted to appropriate types.


< Back