summaryrefslogtreecommitdiff
path: root/src/cli/runtime/PersistentHashtableIdentityMap.cs
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2006-08-04 23:16:49 +0000
committerRich Hickey <richhickey@gmail.com>2006-08-04 23:16:49 +0000
commit7e9b97b213b0214238c244eff9389554adcba54e (patch)
tree8e7a1565426f6a0805723dc935cee96ab6e3012a /src/cli/runtime/PersistentHashtableIdentityMap.cs
parentae23e1e284833c61924cc09f4053ded4cc96cc44 (diff)
got rid of identity maps
Diffstat (limited to 'src/cli/runtime/PersistentHashtableIdentityMap.cs')
-rw-r--r--src/cli/runtime/PersistentHashtableIdentityMap.cs111
1 files changed, 0 insertions, 111 deletions
diff --git a/src/cli/runtime/PersistentHashtableIdentityMap.cs b/src/cli/runtime/PersistentHashtableIdentityMap.cs
deleted file mode 100644
index 5ea01457..00000000
--- a/src/cli/runtime/PersistentHashtableIdentityMap.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-/**
- * Copyright (c) Rich Hickey. All rights reserved.
- * The use and distribution terms for this software are covered by the
- * Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
- * which can be found in the file CPL.TXT at the root of this distribution.
- * By using this software in any fashion, you are agreeing to be bound by
- * the terms of this license.
- * You must not remove this notice, or any other, from this software.
- **/
-
-using System;
-using System.Collections;
-
-namespace clojure.lang
- {
-
-public class PersistentHashtableIdentityMap : PersistentHashtableMap {
-
-public PersistentHashtableIdentityMap(int initialCapacity) : base(initialCapacity) {
-}
-
-public PersistentHashtableIdentityMap(Object[] init) : base(init){
-}
-
-PersistentHashtableIdentityMap(int count, PersistentArray array) : base(count, array) {
-}
-
-PersistentHashtableIdentityMap(int i, PersistentArray newArray, int growAtCount):base(i,newArray,growAtCount){
-}
-
-
-override public IEnumerator GetEnumerator()
- {
- return new Iter2(array);
- }
-
-
-internal class Iter2 : IEnumerator
- {
- PersistentArray buckets;
- int b;
- Object e;
-
- internal Iter2(PersistentArray buckets)
- {
- this.buckets = buckets;
- this.b = -1;
- }
-
- private void nextBucket()
- {
- e = null;
- for (b = b + 1; b < buckets.length(); b++)
- {
- Object a = buckets.get(b);
- if (a != null && a != PersistentListIdentityMap.EMPTY)
- {
- e = a;
- break;
- }
- }
- }
-
- #region IEnumerator Members
-
- public object Current
- {
- get { return e; }
- }
-
- public bool MoveNext()
- {
- if (e == null || (e = ((PersistentListIdentityMap)e).next()) == PersistentListIdentityMap.EMPTY)
- nextBucket();
- return e != null;
- }
-
- public void Reset()
- {
- throw new Exception("The method or operation is not implemented.");
- }
-
- #endregion
- }
-
-
-internal override IPersistentMap create(int capacity) {
- PersistentHashtableIdentityMap ret = new PersistentHashtableIdentityMap(capacity);
- ret._meta = _meta;
- return ret;
- }
-
-internal override IPersistentMap create(int count, PersistentArray array) {
- PersistentHashtableIdentityMap ret = new PersistentHashtableIdentityMap(count, array);
- ret._meta = _meta;
- return ret;
- }
-
-internal override IPersistentMap create(int i, PersistentArray newArray, int growAtCount){
- PersistentHashtableIdentityMap ret = new PersistentHashtableIdentityMap(i, newArray, growAtCount);
- ret._meta = _meta;
- return ret;
- }
-
-internal override IPersistentMap createListMap(Object key, Object val){
- return PersistentListIdentityMap.create(key,val);
-}
-
-}
-
-}