Skip to content

Commit 5403cbe

Browse files
committed
Comments and refactoring
1 parent ee28b82 commit 5403cbe

File tree

8 files changed

+74
-11
lines changed

8 files changed

+74
-11
lines changed

CodeJam.sln.GhostDoc.xml

+1
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@
4848
</HelpConfiguration>
4949
</HelpConfigurations>
5050
<GeneralProperties>
51+
<SearchInheritedCommentsOnlyWithinProject>False</SearchInheritedCommentsOnlyWithinProject>
5152
</GeneralProperties>
5253
</GhostDoc>

Main/src/CodeJam.Main.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
<Compile Include="TableData\DataLine.cs" />
120120
<Compile Include="TableData\FixedWidthFormat.cs" />
121121
<Compile Include="TableData\ITableDataFormatter.cs" />
122+
<Compile Include="TableData\NamespaceDoc.cs" />
122123
<Compile Include="TableData\TableDataParser.cs" />
123124
<Compile Include="TableData\TableDataPrinter.cs" />
124125
<Compile Include="Targeting\CustomAttributeExtensions.cs" />

Main/src/Collections/DictionaryExtensions.cs

+49-7
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,17 @@ public static class DictionaryExtensions
1313
{
1414
#region GetValueOrDefault
1515
/// <summary>
16-
/// Returns value associated with <paramref name="key"/>, or default(TValue) if key does not exists in
17-
/// <paramref name="dictionary"/>
16+
/// Returns value associated with <paramref name="key" />, or default(TValue) if key does not exists in
17+
/// <paramref name="dictionary" />
1818
/// </summary>
19+
/// <typeparam name="TKey">The type of the key.</typeparam>
20+
/// <typeparam name="TValue">The type of the value.</typeparam>
21+
/// <param name="dictionary">The dictionary.</param>
22+
/// <param name="key">The key.</param>
23+
/// <returns>
24+
/// Value, associated with the <paramref name="key"/>, or default value if <paramref name="key"/> does not exists
25+
/// in <paramref name="dictionary"/>
26+
/// </returns>
1927
[Pure]
2028
public static TValue GetValueOrDefault<TKey, TValue>([NotNull] this IDictionary<TKey, TValue> dictionary, TKey key)
2129
{
@@ -32,6 +40,14 @@ public static TValue GetValueOrDefault<TKey, TValue>([NotNull] this IDictionary<
3240
/// Returns value associated with <paramref name="key"/>, or default(TValue) if key does not exists in
3341
/// <paramref name="dictionary"/>
3442
/// </summary>
43+
/// <typeparam name="TKey">The type of the key.</typeparam>
44+
/// <typeparam name="TValue">The type of the value.</typeparam>
45+
/// <param name="dictionary">The dictionary.</param>
46+
/// <param name="key">The key.</param>
47+
/// <returns>
48+
/// Value, associated with the <paramref name="key"/>, or default value if <paramref name="key"/> does not exists
49+
/// in <paramref name="dictionary"/>
50+
/// </returns>
3551
// Resolve ambiguity between IDictionary and IReadOnlyDictionary in System.Dictionary class.
3652
[Pure]
3753
public static TValue GetValueOrDefault<TKey, TValue>([NotNull] this Dictionary<TKey, TValue> dictionary, TKey key) =>
@@ -41,6 +57,14 @@ public static TValue GetValueOrDefault<TKey, TValue>([NotNull] this Dictionary<T
4157
/// Returns value associated with <paramref name="key"/>, or default(TValue) if key does not exists in
4258
/// <paramref name="dictionary"/>
4359
/// </summary>
60+
/// <typeparam name="TKey">The type of the key.</typeparam>
61+
/// <typeparam name="TValue">The type of the value.</typeparam>
62+
/// <param name="dictionary">The dictionary.</param>
63+
/// <param name="key">The key.</param>
64+
/// <returns>
65+
/// Value, associated with the <paramref name="key"/>, or default value if <paramref name="key"/> does not exists
66+
/// in <paramref name="dictionary"/>
67+
/// </returns>
4468
[Pure]
4569
public static TValue GetValueOrDefault<TKey, TValue>(
4670
[NotNull] this IReadOnlyDictionary<TKey, TValue> dictionary,
@@ -59,6 +83,15 @@ public static TValue GetValueOrDefault<TKey, TValue>(
5983
/// Returns value associated with <paramref name="key"/>, or <paramref name="defaultValue"/> if key does not exists
6084
/// in <paramref name="dictionary"/>
6185
/// </summary>
86+
/// <typeparam name="TKey">The type of the key.</typeparam>
87+
/// <typeparam name="TValue">The type of the value.</typeparam>
88+
/// <param name="dictionary">The dictionary.</param>
89+
/// <param name="key">The key.</param>
90+
/// <param name="defaultValue">Default value.</param>
91+
/// <returns>
92+
/// Value, associated with the <paramref name="key"/>, or <paramref name="defaultValue"/> if <paramref name="key"/>
93+
/// does not exists in <paramref name="dictionary"/>
94+
/// </returns>
6295
[Pure]
6396
public static TValue GetValueOrDefault<TKey, TValue>(
6497
[NotNull] this IDictionary<TKey, TValue> dictionary,
@@ -78,6 +111,15 @@ public static TValue GetValueOrDefault<TKey, TValue>(
78111
/// Returns value associated with <paramref name="key"/>, or value returned by <paramref name="defaultValueFactory"/>
79112
/// if key does not exists in <paramref name="dictionary"/>
80113
/// </summary>
114+
/// <typeparam name="TKey">The type of the key.</typeparam>
115+
/// <typeparam name="TValue">The type of the value.</typeparam>
116+
/// <param name="dictionary">The dictionary.</param>
117+
/// <param name="key">The key.</param>
118+
/// <param name="defaultValueFactory">Function to return default value.</param>
119+
/// <returns>
120+
/// Value, associated with the <paramref name="key"/>, or value returned by <paramref name="defaultValueFactory"/>
121+
/// if <paramref name="key"/> does not exists in <paramref name="dictionary"/>
122+
/// </returns>
81123
[Pure]
82124
public static TValue GetValueOrDefault<TKey, TValue>(
83125
[NotNull] this IDictionary<TKey, TValue> dictionary,
@@ -99,7 +141,7 @@ public static TValue GetValueOrDefault<TKey, TValue>(
99141
/// <summary>
100142
/// Adds a key/value pair to the <see cref="IDictionary{TKey,TValue}"/> if the key does not already exist.
101143
/// </summary>
102-
/// <param name="dictionary"></param>
144+
/// <param name="dictionary">The dictionary.</param>
103145
/// <param name="key">The key of the element to add.</param>
104146
/// <returns>
105147
/// The value for the key. This will be either the existing value for the key if the key is already in the
@@ -122,7 +164,7 @@ public static TValue GetOrAdd<TKey, TValue>([NotNull] this IDictionary<TKey, TVa
122164
/// <summary>
123165
/// Adds a key/value pair to the <see cref="IDictionary{TKey,TValue}"/> if the key does not already exist.
124166
/// </summary>
125-
/// <param name="dictionary"></param>
167+
/// <param name="dictionary">The dictionary.</param>
126168
/// <param name="key">The key of the element to add.</param>
127169
/// <param name="value">the value to be added, if the key does not already exist</param>
128170
/// <returns>
@@ -148,7 +190,7 @@ public static TValue GetOrAdd<TKey, TValue>(
148190
/// <summary>
149191
/// Adds a key/value pair to the <see cref="IDictionary{TKey,TValue}"/> if the key does not already exist.
150192
/// </summary>
151-
/// <param name="dictionary"></param>
193+
/// <param name="dictionary">The dictionary.</param>
152194
/// <param name="key">The key of the element to add.</param>
153195
/// <param name="valueFactory">The function used to generate a value for the key</param>
154196
/// <returns>
@@ -177,7 +219,7 @@ public static TValue GetOrAdd<TKey, TValue>(
177219
/// or updates a key/value pair <see cref="IDictionary{TKey,TValue}"/> by using the specified function
178220
/// if the key already exists.
179221
/// </summary>
180-
/// <param name="dictionary"></param>
222+
/// <param name="dictionary">The dictionary.</param>
181223
/// <param name="key">The key to be added or whose value should be updated</param>
182224
/// <param name="addValue">The value to be added for an absent key</param>
183225
/// <param name="updateValueFactory">The function used to generate a new value for an existing key based on the key's existing value</param>
@@ -210,7 +252,7 @@ public static TValue AddOrUpdate<TKey, TValue>(
210252
/// or updates a key/value pair <see cref="IDictionary{TKey,TValue}"/> by using the specified function
211253
/// if the key already exists.
212254
/// </summary>
213-
/// <param name="dictionary"></param>
255+
/// <param name="dictionary">The dictionary.</param>
214256
/// <param name="key">The key to be added or whose value should be updated</param>
215257
/// <param name="addValueFactory">The function used to generate a value for an absent key</param>
216258
/// <param name="updateValueFactory">The function used to generate a new value for an existing key based on the key's existing value</param>

Main/src/Strings/NamespaceDoc.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace CodeJam.Strings
44
{
55
#if DEBUG
66
/// <summary>
7-
/// The <see cref="CodeJam.Strings"/> namespaces contain types for <see cref="char"/> and <see cref="string"/>
7+
/// The <see cref="Strings"/> namespace contains types for <see cref="char"/> and <see cref="string"/>
88
/// manipulation.
99
/// </summary>
1010
[UsedImplicitly]

Main/src/TableData/CsvFormat.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ private enum ParserState
231231
#endregion
232232
#endregion
233233

234-
#region Formatter
234+
#region Formatter
235235
/// <summary>
236236
/// Creates formatter for CSV.
237237
/// </summary>

Main/src/TableData/DataLine.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ namespace CodeJam.TableData
1212
[PublicAPI]
1313
public struct DataLine
1414
{
15-
/// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary>
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="T:System.Object" /> class.
17+
/// </summary>
18+
/// <param name="lineNum">The line number.</param>
19+
/// <param name="values">Line values.</param>
1620
public DataLine(int lineNum, string[] values)
1721
{
1822
LineNum = lineNum;

Main/src/TableData/NamespaceDoc.cs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using JetBrains.Annotations;
2+
3+
namespace CodeJam.TableData
4+
{
5+
#if DEBUG
6+
/// <summary>
7+
/// The <see cref="TableData"/> namespace contains types for working with CSV and fixed with text data formats.
8+
/// </summary>
9+
[UsedImplicitly]
10+
public class NamespaceDoc
11+
{
12+
13+
}
14+
#endif
15+
}

Main/src/TableData/TableDataParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace CodeJam.TableData
88
{
99
/// <summary>
10-
///
10+
/// Contains methods for table data parsing.
1111
/// </summary>
1212
[PublicAPI]
1313
public static class TableDataParser

0 commit comments

Comments
 (0)