Class FinStatusSegment
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
aSegmentFinSegmentA 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
this[int]
Indexer returns the entire status record at the given index.
public FinStatus this[int nStatusIndex] { get; }
Parameters
nStatusIndexint
Property Value
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
Success
Indicates whether the overall status is successful.
public bool Success { get; }
Property Value
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
Methods
ContainsCode(int)
Determines whether a particular status code exists in this status segment.
public bool ContainsCode(int nCode)
Parameters
nCodeintThe status code that is sought.
Returns
- bool
If the requested status code exists, then
trueis returned. If it was not found, thenfalseis returned.
FindAllStatus(int)
Retrievs all status entries with the given status code.
public FinStatus[] FindAllStatus(int nStatusCode)
Parameters
nStatusCodeintThe 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
nCodeintThe 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
nStatusCodeintThe 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
nullis 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
nStatusIndexintZero 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
nStatusIndexintZero 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()