Lucene.Net.Core.Support: Deleted unused Single class
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/fa0a6d55 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/fa0a6d55 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/fa0a6d55 Branch: refs/heads/api-work Commit: fa0a6d55209e0c7950debd0006c96cbf061a740d Parents: 9a657cd Author: Shad Storhaug <[email protected]> Authored: Tue Jan 31 11:48:14 2017 +0700 Committer: Shad Storhaug <[email protected]> Committed: Tue Jan 31 11:48:14 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Lucene.Net.csproj | 1 - src/Lucene.Net.Core/Support/Single.cs | 121 ----------------------------- 2 files changed, 122 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa0a6d55/src/Lucene.Net.Core/Lucene.Net.csproj ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Lucene.Net.csproj b/src/Lucene.Net.Core/Lucene.Net.csproj index ebe727c..18258f7 100644 --- a/src/Lucene.Net.Core/Lucene.Net.csproj +++ b/src/Lucene.Net.Core/Lucene.Net.csproj @@ -687,7 +687,6 @@ <Compile Include="Support\Number.cs" /> <Compile Include="Support\OS.cs" /> <Compile Include="Support\SharpZipLib.cs" /> - <Compile Include="Support\Single.cs" /> <Compile Include="Support\TextSupport.cs" /> <Compile Include="Support\ThreadClass.cs" /> <Compile Include="Support\ThreadLock.cs" /> http://git-wip-us.apache.org/repos/asf/lucenenet/blob/fa0a6d55/src/Lucene.Net.Core/Support/Single.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Support/Single.cs b/src/Lucene.Net.Core/Support/Single.cs deleted file mode 100644 index edac46f..0000000 --- a/src/Lucene.Net.Core/Support/Single.cs +++ /dev/null @@ -1,121 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * -*/ - -using System; -using System.Globalization; - -namespace Lucene.Net.Support -{ - /// <summary> - /// - /// </summary> - public class Single - { - /// <summary> - /// - /// </summary> - /// <param name="s"></param> - /// <param name="style"></param> - /// <param name="provider"></param> - /// <returns></returns> - public static System.Single Parse(System.String s, System.Globalization.NumberStyles style, System.IFormatProvider provider) - { - if (s.EndsWith("f") || s.EndsWith("F")) - return System.Single.Parse(s.Substring(0, s.Length - 1), style, provider); - else - return System.Single.Parse(s, style, provider); - } - - /// <summary> - /// - /// </summary> - /// <param name="s"></param> - /// <param name="provider"></param> - /// <returns></returns> - public static System.Single Parse(System.String s, System.IFormatProvider provider) - { - if (s.EndsWith("f") || s.EndsWith("F")) - return System.Single.Parse(s.Substring(0, s.Length - 1), provider); - else - return System.Single.Parse(s, provider); - } - - /// <summary> - /// - /// </summary> - /// <param name="s"></param> - /// <param name="style"></param> - /// <returns></returns> - public static System.Single Parse(System.String s, System.Globalization.NumberStyles style) - { - if (s.EndsWith("f") || s.EndsWith("F")) - return System.Single.Parse(s.Substring(0, s.Length - 1), style); - else - return System.Single.Parse(s, style); - } - - /// <summary> - /// - /// </summary> - /// <param name="s"></param> - /// <returns></returns> - public static System.Single Parse(System.String s) - { - if (s.EndsWith("f") || s.EndsWith("F")) - return System.Single.Parse(s.Substring(0, s.Length - 1).Replace(".", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); - else - return System.Single.Parse(s.Replace(".", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator)); - } - - public static bool TryParse(System.String s, out float f) - { - bool ok = false; - - if (s.EndsWith("f") || s.EndsWith("F")) - ok = System.Single.TryParse(s.Substring(0, s.Length - 1).Replace(".", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator), out f); - else - ok = System.Single.TryParse(s.Replace(".", CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator), out f); - - return ok; - } - - /// <summary> - /// - /// </summary> - /// <param name="f"></param> - /// <returns></returns> - public static string ToString(float f) - { - return f.ToString().Replace(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator, "."); - } - - /// <summary> - /// - /// </summary> - /// <param name="f"></param> - /// <param name="format"></param> - /// <returns></returns> - public static string ToString(float f, string format) - { - return f.ToString(format).Replace(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator, "."); - } - } -} \ No newline at end of file
