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:
committed by
Kubernetes Prow Robot
parent
161015ab86
commit
cd7cda5836
@@ -1,6 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Fractions.Extensions {
|
namespace k8s.Internal.Fractions.Extensions {
|
||||||
internal static class MathExt {
|
internal static class MathExt {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks for an even number.
|
/// Checks for an even number.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Fractions.Formatter {
|
namespace k8s.Internal.Fractions.Formatter {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default <see cref="Fraction.ToString()"/> formatter.
|
/// Default <see cref="Fraction.ToString()"/> formatter.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class DefaultFractionFormatProvider : IFormatProvider {
|
internal class DefaultFractionFormatProvider : IFormatProvider {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Singleton instance
|
/// Singleton instance
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using System.Globalization;
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Fractions.Formatter {
|
namespace k8s.Internal.Fractions.Formatter {
|
||||||
internal class DefaultFractionFormatter : ICustomFormatter {
|
internal class DefaultFractionFormatter : ICustomFormatter {
|
||||||
public static readonly ICustomFormatter Instance = new DefaultFractionFormatter();
|
public static readonly ICustomFormatter Instance = new DefaultFractionFormatter();
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction
|
internal partial struct Fraction
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compares the calculated value with the supplied <paramref name="other"/>.
|
/// Compares the calculated value with the supplied <paramref name="other"/>.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction
|
internal partial struct Fraction
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a fraction with <paramref name="numerator"/>, <paramref name="denominator"/> and the fraction' <paramref name="state"/>.
|
/// Create a fraction with <paramref name="numerator"/>, <paramref name="denominator"/> and the fraction' <paramref name="state"/>.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Fractions.Extensions;
|
using k8s.Internal.Fractions.Extensions;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction {
|
internal partial struct Fraction {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts a string to a fraction. Example: "3/4" or "4.5" (the decimal separator character is depending on the system culture).
|
/// 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"/>.
|
/// If the number contains a decimal separator it will be parsed as <see cref="decimal"/>.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction {
|
internal partial struct Fraction {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the fraction as signed 32bit integer.
|
/// Returns the fraction as signed 32bit integer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction
|
internal partial struct Fraction
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tests if the calculated value of this fraction equals to the calculated value of <paramref name="other"/>.
|
/// Tests if the calculated value of this fraction equals to the calculated value of <paramref name="other"/>.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction {
|
internal partial struct Fraction {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Calculates the remainder of the division with the fraction's value and the supplied <paramref name="divisor"/> (% operator).
|
/// Calculates the remainder of the division with the fraction's value and the supplied <paramref name="divisor"/> (% operator).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction {
|
internal partial struct Fraction {
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
public static bool operator ==(Fraction left, Fraction right) {
|
public static bool operator ==(Fraction left, Fraction right) {
|
||||||
return left.Equals(right);
|
return left.Equals(right);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Fractions.Formatter;
|
using k8s.Internal.Fractions.Formatter;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
public partial struct Fraction {
|
internal partial struct Fraction {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the fraction as "numerator/denominator" or just "numerator" if the denominator has a value of 1.
|
/// 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" />).
|
/// The returning value is culture invariant (<see cref="CultureInfo" />).
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ using System;
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Fractions.TypeConverters;
|
using k8s.Internal.Fractions.TypeConverters;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A mathematical fraction. A rational number written as a/b (a is the numerator and b the denominator).
|
/// 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.
|
/// The data type is not capable to store NaN (not a number) or infinite.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[TypeConverter(typeof (FractionTypeConverter))]
|
[TypeConverter(typeof (FractionTypeConverter))]
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
[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 MIN_DECIMAL = new BigInteger(decimal.MinValue);
|
||||||
private static readonly BigInteger MAX_DECIMAL = new BigInteger(decimal.MaxValue);
|
private static readonly BigInteger MAX_DECIMAL = new BigInteger(decimal.MaxValue);
|
||||||
private static readonly Fraction _zero = new Fraction(BigInteger.Zero, BigInteger.Zero, FractionState.IsNormalized);
|
private static readonly Fraction _zero = new Fraction(BigInteger.Zero, BigInteger.Zero, FractionState.IsNormalized);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The fraction's state.
|
/// The fraction's state.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum FractionState
|
internal enum FractionState
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Unknown state.
|
/// Unknown state.
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Fractions {
|
namespace k8s.Internal.Fractions {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Exception that will be thrown if an argument contains not a number (NaN) or is infinite.
|
/// Exception that will be thrown if an argument contains not a number (NaN) or is infinite.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class InvalidNumberException : ArithmeticException {
|
internal class InvalidNumberException : ArithmeticException {
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
public InvalidNumberException() {}
|
public InvalidNumberException() {}
|
||||||
public InvalidNumberException(string message) : base(message) {}
|
public InvalidNumberException(string message) : base(message) {}
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ using System.ComponentModel;
|
|||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace Fractions.TypeConverters {
|
namespace k8s.Internal.Fractions.TypeConverters {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts the <see cref="Fraction"/> from / to various data types.
|
/// Converts the <see cref="Fraction"/> from / to various data types.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public sealed class FractionTypeConverter : TypeConverter {
|
internal sealed class FractionTypeConverter : TypeConverter {
|
||||||
private static readonly HashSet<Type> SUPPORTED_TYPES = new HashSet<Type> {
|
private static readonly HashSet<Type> SUPPORTED_TYPES = new HashSet<Type> {
|
||||||
typeof (string),
|
typeof (string),
|
||||||
typeof (int),
|
typeof (int),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Fractions;
|
using k8s.Internal.Fractions;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using YamlDotNet.Core;
|
using YamlDotNet.Core;
|
||||||
using YamlDotNet.Core.Events;
|
using YamlDotNet.Core.Events;
|
||||||
|
|||||||
Reference in New Issue
Block a user