Class FinStatusSegment

Namespace
Subsembly.FinTS
Assembly
Subsembly.FinTS.Core.dll

A FinStatusSegment is a specialisation of a generic FinSegment for HIRMG or HIRMS status segments.

public class FinStatusSegment : IEnumerable
Inheritance
FinStatusSegment
Implements
Inherited Members

Remarks

A FinStatusSegment provides convenient access to the up to 99 status entries of a HIRMG or HIRMS segment. The status entries can be accessed by a 1-based index, and can be enumerated or sought in various ways.

Additional convenience properties classify whether the overall status of this status segment indicates success, a warning or a failure.

Constructors

FinStatusSegment(FinSegment)

Contruct a FinStatusSegment wrapper on top of a FinStatus instance that holds an HIRMG or HIRMS segment.

public FinStatusSegment(FinSegment aSegment)

Parameters

aSegment FinSegment

A FinStatus instance that holds an HIRMG or HIRMS segment.

Remarks

The status segment is immediately evaluated and the results are cached. Thus any subsequent changes to the underlying HIRMG/HIRMS segment will lead to confusion and unexpected results.

Exceptions

ArgumentNullException

If the parameter aSegment is null, then an ArgumentNullException will be thrown.

ArgumentOutOfRangeException

If the given segment is neither a HIRMG nor a HIRMS segment, then an ArgumentOutOfRangeException will be thrown.

Properties

Count

The count of status records in this status segment.

public int Count { get; }

Property Value

int

this[int]

Indexer returns the entire status record at the given index.

public FinStatus this[int nStatusIndex] { get; }

Parameters

nStatusIndex int

Property Value

FinStatus

ScrollRef

Returns the scroll reference (Aufsetzpunkt) from this status segment.

public string ScrollRef { get; }

Property Value

string

A scroll reference is the first parameter of a warnung with status code 3040. If no such scroll reference is included in this status segment, then this property is returned as null.

Segment

Direct access to HIRMS/HIRMG segment wrapped by this FinStatusSegment instance.

public FinSegment Segment { get; }

Property Value

FinSegment

Success

Indicates whether the overall status is successful.

public bool Success { get; }

Property Value

bool

Remarks

Regardless of whether successful or not, there still may be some additional warnings. The property Warnings indicates whether there are any warnings.

Warnings

Indicates whether there are any warnings.

public bool Warnings { get; }

Property Value

bool

Methods

ContainsCode(int)

Determines whether a particular status code exists in this status segment.

public bool ContainsCode(int nCode)

Parameters

nCode int

The status code that is sought.

Returns

bool

If the requested status code exists, then true is returned. If it was not found, then false is returned.

FindAllStatus(int)

Retrievs all status entries with the given status code.

public FinStatus[] FindAllStatus(int nStatusCode)

Parameters

nStatusCode int

The status code to find.

Returns

FinStatus[]

Possibly empty array of all status entries with the given nStatusCode.

FindCode(int)

Finds a particular status code in this status segment.

public int FindCode(int nCode)

Parameters

nCode int

The status code that is sought.

Returns

int

If the sought status code was found, then the zero based index of its first occurence is returned. If the sought status code does not exist in this status segment, then -1 is returned.

FindMax()

Find the highest, and thus probably the worst, status code in this status segment.

public int FindMax()

Returns

int

Warning: This does not return the highet status code, as one might expect, but the zero based index of the status record that contains the highest status code is returned.

FindStatus(int)

Tries to find the first status with the given code.

public FinStatus FindStatus(int nStatusCode)

Parameters

nStatusCode int

The status code to find.

Returns

FinStatus

If a status with the given code was found, then a new FinStatus instance is returned, that wraps it. If the code was not found, then null is returned.

GetEnumerator()

Returns an enumerator that can be used to iterate all status records as FinStatus instances.

public IEnumerator GetEnumerator()

Returns

IEnumerator

The enumerator.

GetStatus(int)

Gets the entire status record at the given index.

public FinStatus GetStatus(int nStatusIndex)

Parameters

nStatusIndex int

Zero based index of status record.

Returns

FinStatus

The status record.

GetStatusCode(int)

Gets the status code of the status record at the given index.

public int GetStatusCode(int nStatusIndex)

Parameters

nStatusIndex int

Zero based index of status record.

Returns

int

The status code.

ToString()

Creates an human readable string from all status entries in this status segment.

public override string ToString()

Returns

string