Index: Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs
===================================================================
diff -u -r66a3f4e698599226d8f9c1ffba5439b2a8def19f -r0e2e6063204924f981e049973bf1c2b3598f8451
--- Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision 66a3f4e698599226d8f9c1ffba5439b2a8def19f)
+++ Ringtoets/Common/src/Ringtoets.Common.IO/Structures/StructuresCharacteristicsCsvReader.cs (.../StructuresCharacteristicsCsvReader.cs) (revision 0e2e6063204924f981e049973bf1c2b3598f8451)
@@ -34,7 +34,7 @@
{
///
/// File reader for a plain text file in comma-separated values format (*.csv) containing
- /// data specifying characteristics of height structures.
+ /// data specifying characteristics of structures.
///
public class StructuresCharacteristicsCsvReader : IDisposable
{
@@ -74,8 +74,8 @@
/// Counts the number of parameter definitions found in the file.
///
/// An integer greater than or equal to 0, being the number of parameter rows.
- /// File/directory cannot be found or
- /// some other I/O related problem occurred or the header is not in the required format.
+ /// Thrown when the file/directory cannot be found,
+ /// some I/O related problem occurred or the header is not in the required format.
public int GetLineCount()
{
using (var reader = StreamReaderHelper.InitializeStreamReader(filePath))
@@ -90,8 +90,8 @@
///
/// Reads the next structure parameter from file.
///
- /// The next based on the read file,
- /// or null when at the end of the file.
+ /// The next based on the read file,
+ /// or null when at the end of the file.
///
/// Thrown when either:
///
@@ -103,8 +103,8 @@
/// Thrown when either:
///
/// - The line does not contain the separator character.
- /// - Location id field is empty or consists out of only white spaces.
- /// - Parameter id field is empty or consists out of only white spaces.
+ /// - Location id field is empty or consists only of white-space characters.
+ /// - Parameter id field is empty or consists only of white-space characters.
/// - Numeric value field is not a number or too large/small to be represented as .
/// - Variance value field is not a number or too large/small to be represented as .
/// - Boolean field is not a valid value.
@@ -149,7 +149,7 @@
/// Validates the header of the file.
///
/// The reader, which is currently at the header row.
- /// The header is not in the required format.
+ /// Thrown when the header is not in the required format.
private void ValidateHeader(TextReader reader)
{
string[] tokenizedHeader = GetTokenizedHeader(reader);
@@ -164,7 +164,7 @@
/// The reader at the row from which counting should start.
/// The current line, used for error messaging.
/// An integer greater than or equal to 0, being the number of parameter rows.
- /// An I/O exception occurred.
+ /// Thrown when an I/O exception occurred.
private int CountNonEmptyLines(TextReader reader, int currentLine)
{
int count = 0, lineNumberForMessage = currentLine;
@@ -185,8 +185,8 @@
///
/// The opened text file reader.
/// Row number for error messaging.
- /// The read line, or null when at the end of the file.
- /// An critical I/O exception occurred.
+ /// The read line, or null when at the end of the file.
+ /// Thrown when a critical I/O exception occurred.
private string ReadLineAndHandleIOExceptions(TextReader reader, int currentLine)
{
try
@@ -210,8 +210,8 @@
/// Reads the header and sets the internal indices of the required header columns.
///
/// The reader used to read the file.
- /// The file is empty or some I/O exception
- /// occurred or the header is not in the required format.
+ /// Thrown when the file is empty, some I/O exception
+ /// occurred, or the header is not in the required format.
private void IndexFile(TextReader reader)
{
string[] tokenizedHeader = GetTokenizedHeader(reader);
@@ -230,7 +230,7 @@
///
/// The reader used to read the file.
/// The header split based on .
- /// The file is empty or some I/O exception
+ /// Thrown when the file is empty or some I/O exception
/// occurred.
private string[] GetTokenizedHeader(TextReader reader)
{
@@ -275,7 +275,7 @@
///
/// The array of matched column indices.
/// The initial index value put in .
- /// The header is not in the required format.
+ /// Thrown when the header is not in the required format.
private void ValidateRequiredColumnIndices(int[] requiredHeaderColumnIndices, int uninitializedValue)
{
if (requiredHeaderColumnIndices.Any(i => i == uninitializedValue))
@@ -301,7 +301,7 @@
///
/// The next line which is not a white line, or null when no non-white
/// line could be found before the end of file.
- /// An critical I/O exception occurred.
+ /// Thrown when a critical I/O exception occurred.
private string ReadNextNonEmptyLine(StreamReader reader)
{
string readText;
@@ -323,12 +323,12 @@
/// Creates the structures parameter row.
///
/// The read text.
- ///
+ /// The created structures parameter row.
/// Thrown when either:
///
/// - does not contain the separator character.
- /// - Location id field is empty or consists out of only white spaces.
- /// - Parameter id field is empty or consists out of only white spaces.
+ /// - Location id field is empty or consists only of white-space characters.
+ /// - Parameter id field is empty or consists only of white-space characters.
/// - Numeric value field is not a number or too large/small to be represented as .
/// - Variance value field is not a number or too large/small to be represented as .
/// - Boolean field is not a valid value.
@@ -347,7 +347,7 @@
string locationId = ParseLocationId(tokenizedText);
string parameterId = ParseParameterId(tokenizedText);
string alphanumericValue = ParseAlphanumericValue(tokenizedText);
- double numbericValue = ParseNumericValue(tokenizedText);
+ double numericValue = ParseNumericValue(tokenizedText);
double varianceValue = ParseVarianceValue(tokenizedText);
VarianceType varianceType = ParseVarianceType(tokenizedText);
@@ -356,7 +356,7 @@
LocationId = locationId,
ParameterId = parameterId,
AlphanumericValue = alphanumericValue,
- NumericalValue = numbericValue,
+ NumericalValue = numericValue,
VarianceValue = varianceValue,
VarianceType = varianceType,
LineNumber = lineNumber
@@ -366,9 +366,9 @@
///
/// Tokenizes a string using a separator character up to the first empty field.
///
- /// The text.
+ /// The read text.
/// The tokenized parts.
- /// lacks separator character.
+ /// Thrown when lacks separator character.
private string[] TokenizeString(string readText)
{
if (!readText.Contains(separator))
@@ -386,7 +386,8 @@
///
/// The tokenized text.
/// The location ID.
- /// Location ID field is empty or only has whitespaces.
+ /// Thrown when the field Location ID is empty
+ /// or consists only of white-space characters.
private string ParseLocationId(string[] tokenizedText)
{
string locationId = tokenizedText[locationIdIndex];
@@ -397,9 +398,9 @@
/// Parses the parameter identifier from the read text.
///
/// The tokenized text.
- ///
/// The parameter ID.
- /// Parameter ID field is empty or only has whitespaces.
+ /// Thrown when the field Parameter ID is empty
+ /// or consists only of white-space characters.
private string ParseParameterId(string[] tokenizedText)
{
string parameterId = tokenizedText[parameterIdIndex];
@@ -427,7 +428,7 @@
///
/// The tokenized text.
/// The numeric value (can be ).
- /// When the numeric value field is not a number
+ /// Thrown when the numeric value field is not a number
/// or when it's too large or too small to be represented as .
private double ParseNumericValue(string[] tokenizedText)
{
@@ -440,7 +441,7 @@
///
/// The tokenized text.
/// The standard deviation or coefficient of variation value (can be ).
- /// When the standard deviation or coefficient
+ /// Thrown when the standard deviation or coefficient
/// of variation value field is not a number or when it's too large or too small
/// to be represented as .
private double ParseVarianceValue(string[] tokenizedText)
@@ -454,9 +455,9 @@
///
/// The value text to be parsed.
/// Name of the parameter.
- /// when is null
- /// or only whitespaces; otherwise the parsed number.
- /// When is
+ /// when is null
+ /// or only whitespaces; otherwise the parsed value.
+ /// Thrown when is
/// not a number or when it's too large or too small to be represented as .
private double ParseDoubleValue(string doubleValueText, string parameterName)
{
@@ -484,8 +485,8 @@
/// Parses the value that indicates how the variance field should be interpreted.
///
/// The tokenized text.
- /// The based on the text in the file.
- /// When the 'boolean' field is not a valid value.
+ /// The based on the text in the file.
+ /// Thrown when the 'boolean' field is not a valid value.
private VarianceType ParseVarianceType(string[] tokenizedText)
{
string varianceTypeText = tokenizedText[varianceTypeIndex];
@@ -538,7 +539,7 @@
/// The line number being read.
/// The critical error message.
/// Optional: exception that caused this exception to be thrown.
- /// New with message and inner exception set.
+ /// New with message set.
private CriticalFileReadException CreateCriticalFileReadException(int currentLine, string criticalErrorMessage, Exception innerException = null)
{
string locationDescription = string.Format(CoreCommonUtilsResources.TextFile_On_LineNumber_0_,