Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B45C5200C56 for ; Thu, 30 Mar 2017 19:59:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B305C160B9A; Thu, 30 Mar 2017 17:59:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 55A56160B9E for ; Thu, 30 Mar 2017 19:59:58 +0200 (CEST) Received: (qmail 76795 invoked by uid 500); 30 Mar 2017 17:59:57 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 75545 invoked by uid 99); 30 Mar 2017 17:59:56 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Mar 2017 17:59:56 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BB692E9641; Thu, 30 Mar 2017 17:59:56 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Date: Thu, 30 Mar 2017 18:00:25 -0000 Message-Id: <9bc9255caf1e41089abe09e899d09fdd@git.apache.org> In-Reply-To: <7bf010e5f2ed4d0894637666d0575d94@git.apache.org> References: <7bf010e5f2ed4d0894637666d0575d94@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [30/50] lucenenet git commit: Lucene.Net.Core.Support: Deleted ValueHashSet and ValueList, since they have been consolidated into EquatableSet and EquatableList archived-at: Thu, 30 Mar 2017 17:59:59 -0000 Lucene.Net.Core.Support: Deleted ValueHashSet and ValueList, since they have been consolidated into EquatableSet and EquatableList Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/f25215f5 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/f25215f5 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/f25215f5 Branch: refs/heads/api-work Commit: f25215f5a81ad851304cc35ed1cc73324fbb6e43 Parents: 62160cd Author: Shad Storhaug Authored: Thu Mar 30 09:25:40 2017 +0700 Committer: Shad Storhaug Committed: Thu Mar 30 09:25:40 2017 +0700 ---------------------------------------------------------------------- src/Lucene.Net.Core/Lucene.Net.csproj | 2 - src/Lucene.Net.Core/Support/ValueHashSet.cs | 71 ------------------------ src/Lucene.Net.Core/Support/ValueList.cs | 68 ----------------------- 3 files changed, 141 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f25215f5/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 57211e0..622d7b3 100644 --- a/src/Lucene.Net.Core/Lucene.Net.csproj +++ b/src/Lucene.Net.Core/Lucene.Net.csproj @@ -710,8 +710,6 @@ - - http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f25215f5/src/Lucene.Net.Core/Support/ValueHashSet.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Support/ValueHashSet.cs b/src/Lucene.Net.Core/Support/ValueHashSet.cs deleted file mode 100644 index 6227ae7..0000000 --- a/src/Lucene.Net.Core/Support/ValueHashSet.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections.Generic; -using System.Runtime.Serialization; - -namespace Lucene.Net.Support -{ - /// - /// Java's HashSet is unlike .NET's in that its equals() and hashcode() methods - /// are setup to compare the values of the sets, where in .NET we only check that - /// the references are the same. acts more like the - /// HashSet type in Java by comparing the sets for value equality. - /// - /// - /// - public class ValueHashSet : HashSet - { - public ValueHashSet() - : base() - { } - - public ValueHashSet(IEnumerable collection) - : base(collection) - { } - - public ValueHashSet(IEqualityComparer comparer) - : base(comparer) - { } - -#if FEATURE_SERIALIZABLE - public ValueHashSet(SerializationInfo info, StreamingContext context) - : base(info, context) - { } -#endif - - public ValueHashSet(IEnumerable collection, IEqualityComparer comparer) - : base(collection, comparer) - { } - - - public override bool Equals(object obj) - { - if (obj == this) - { - return true; - } - - if (!(obj is ISet)) - return false; - ICollection c = obj as ICollection; - if (c.Count != Count) - return false; - - // Check to ensure the sets values are the same - return SetEquals(c); - } - - public override int GetHashCode() - { - int h = 0; - var i = GetEnumerator(); - while (i.MoveNext()) - { - T obj = i.Current; - if (!EqualityComparer.Default.Equals(obj, default(T))) - { - h += obj.GetHashCode(); - } - } - return h; - } - } -} http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f25215f5/src/Lucene.Net.Core/Support/ValueList.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Core/Support/ValueList.cs b/src/Lucene.Net.Core/Support/ValueList.cs deleted file mode 100644 index d67ce5c..0000000 --- a/src/Lucene.Net.Core/Support/ValueList.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Lucene.Net.Support -{ - /// - /// Java's ArrayList is unlike .NET's in that its equals() and hashcode() methods - /// are setup to compare the values of the sets, where in .NET we only check that - /// the references are the same. acts more like the - /// HashSet type in Java by comparing the sets for value equality. - /// - /// - /// - public class ValueList : List - { - public ValueList() - : base() - { } - - public ValueList(int capacity) - : base(capacity) - { } - - public ValueList(IEnumerable collection) - : base(collection) - { } - - public object Clone() - { - return new ValueList(this); - } - - public override bool Equals(object obj) - { - if (obj == this) - { - return true; - } - - if (!(obj is List)) - return false; - ICollection c = obj as ICollection; - if (c.Count != Count) - return false; - - // Check to ensure the sets values are the same - return this.SequenceEqual(c); - } - - public override int GetHashCode() - { - int h = 0; - var i = GetEnumerator(); - while (i.MoveNext()) - { - T obj = i.Current; - if (!EqualityComparer.Default.Equals(obj, default(T))) - { - h += obj.GetHashCode(); - } - } - return h; - } - } -}