Mark all Fractions classes as internal (#265)

* Mark all Fractions classes as internal

* Rename the Fractions namespace to k8s.Internal.Fractions
This commit is contained in:
Frederik Carlier
2019-03-22 18:30:51 +01:00
committed by Kubernetes Prow Robot
parent 161015ab86
commit cd7cda5836
16 changed files with 32 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
using System;
namespace Fractions.Extensions {
namespace k8s.Internal.Fractions.Extensions {
internal static class MathExt {
/// <summary>
/// Checks for an even number.

View File

@@ -1,10 +1,10 @@
using System;
namespace Fractions.Formatter {
namespace k8s.Internal.Fractions.Formatter {
/// <summary>
/// Default <see cref="Fraction.ToString()"/> formatter.
/// </summary>
public class DefaultFractionFormatProvider : IFormatProvider {
internal class DefaultFractionFormatProvider : IFormatProvider {
/// <summary>
/// Singleton instance
/// </summary>

View File

@@ -3,7 +3,7 @@ using System.Globalization;
using System.Numerics;
using System.Text;
namespace Fractions.Formatter {
namespace k8s.Internal.Fractions.Formatter {
internal class DefaultFractionFormatter : ICustomFormatter {
public static readonly ICustomFormatter Instance = new DefaultFractionFormatter();

View File

@@ -1,8 +1,8 @@
using System;
using System.Numerics;
namespace Fractions {
public partial struct Fraction
namespace k8s.Internal.Fractions {
internal partial struct Fraction
{
/// <summary>
/// Compares the calculated value with the supplied <paramref name="other"/>.

View File

@@ -1,8 +1,8 @@
using System;
using System.Numerics;
namespace Fractions {
public partial struct Fraction
namespace k8s.Internal.Fractions {
internal partial struct Fraction
{
/// <summary>
/// Create a fraction with <paramref name="numerator"/>, <paramref name="denominator"/> and the fraction' <paramref name="state"/>.

View File

@@ -1,10 +1,10 @@
using System;
using System.Globalization;
using System.Numerics;
using Fractions.Extensions;
using k8s.Internal.Fractions.Extensions;
namespace Fractions {
public partial struct Fraction {
namespace k8s.Internal.Fractions {
internal partial struct Fraction {
/// <summary>
/// Converts a string to a fraction. Example: "3/4" or "4.5" (the decimal separator character is depending on the system culture).
/// If the number contains a decimal separator it will be parsed as <see cref="decimal"/>.

View File

@@ -1,8 +1,8 @@
using System;
using System.Numerics;
namespace Fractions {
public partial struct Fraction {
namespace k8s.Internal.Fractions {
internal partial struct Fraction {
/// <summary>
/// Returns the fraction as signed 32bit integer.
/// </summary>

View File

@@ -1,6 +1,6 @@
namespace Fractions {
public partial struct Fraction
namespace k8s.Internal.Fractions {
internal partial struct Fraction
{
/// <summary>
/// Tests if the calculated value of this fraction equals to the calculated value of <paramref name="other"/>.

View File

@@ -1,8 +1,8 @@
using System;
using System.Numerics;
namespace Fractions {
public partial struct Fraction {
namespace k8s.Internal.Fractions {
internal partial struct Fraction {
/// <summary>
/// Calculates the remainder of the division with the fraction's value and the supplied <paramref name="divisor"/> (% operator).
/// </summary>

View File

@@ -1,7 +1,7 @@
using System.Numerics;
namespace Fractions {
public partial struct Fraction {
namespace k8s.Internal.Fractions {
internal partial struct Fraction {
#pragma warning disable 1591
public static bool operator ==(Fraction left, Fraction right) {
return left.Equals(right);

View File

@@ -1,9 +1,9 @@
using System;
using System.Globalization;
using Fractions.Formatter;
using k8s.Internal.Fractions.Formatter;
namespace Fractions {
public partial struct Fraction {
namespace k8s.Internal.Fractions {
internal partial struct Fraction {
/// <summary>
/// Returns the fraction as "numerator/denominator" or just "numerator" if the denominator has a value of 1.
/// The returning value is culture invariant (<see cref="CultureInfo" />).

View File

@@ -2,16 +2,16 @@ using System;
using System.ComponentModel;
using System.Numerics;
using System.Runtime.InteropServices;
using Fractions.TypeConverters;
using k8s.Internal.Fractions.TypeConverters;
namespace Fractions {
namespace k8s.Internal.Fractions {
/// <summary>
/// A mathematical fraction. A rational number written as a/b (a is the numerator and b the denominator).
/// The data type is not capable to store NaN (not a number) or infinite.
/// </summary>
[TypeConverter(typeof (FractionTypeConverter))]
[StructLayout(LayoutKind.Sequential)]
public partial struct Fraction : IEquatable<Fraction>, IComparable, IComparable<Fraction>, IFormattable {
internal partial struct Fraction : IEquatable<Fraction>, IComparable, IComparable<Fraction>, IFormattable {
private static readonly BigInteger MIN_DECIMAL = new BigInteger(decimal.MinValue);
private static readonly BigInteger MAX_DECIMAL = new BigInteger(decimal.MaxValue);
private static readonly Fraction _zero = new Fraction(BigInteger.Zero, BigInteger.Zero, FractionState.IsNormalized);

View File

@@ -1,8 +1,8 @@
namespace Fractions {
namespace k8s.Internal.Fractions {
/// <summary>
/// The fraction's state.
/// </summary>
public enum FractionState
internal enum FractionState
{
/// <summary>
/// Unknown state.

View File

@@ -1,10 +1,10 @@
using System;
namespace Fractions {
namespace k8s.Internal.Fractions {
/// <summary>
/// Exception that will be thrown if an argument contains not a number (NaN) or is infinite.
/// </summary>
public class InvalidNumberException : ArithmeticException {
internal class InvalidNumberException : ArithmeticException {
#pragma warning disable 1591
public InvalidNumberException() {}
public InvalidNumberException(string message) : base(message) {}

View File

@@ -4,11 +4,11 @@ using System.ComponentModel;
using System.Globalization;
using System.Numerics;
namespace Fractions.TypeConverters {
namespace k8s.Internal.Fractions.TypeConverters {
/// <summary>
/// Converts the <see cref="Fraction"/> from / to various data types.
/// </summary>
public sealed class FractionTypeConverter : TypeConverter {
internal sealed class FractionTypeConverter : TypeConverter {
private static readonly HashSet<Type> SUPPORTED_TYPES = new HashSet<Type> {
typeof (string),
typeof (int),

View File

@@ -2,7 +2,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using Fractions;
using k8s.Internal.Fractions;
using Newtonsoft.Json;
using YamlDotNet.Core;
using YamlDotNet.Core.Events;