3939 *
4040 * @param <T> the value type
4141 */
42- public class TripleIntObjectReferenceArrayMap <T > implements TripleIntObjectMap < T > {
42+ public class TripleIntObjectReferenceArrayMap <T > {
4343
4444 private final int bits ;
4545 private final int doubleBits ;
@@ -49,7 +49,6 @@ public class TripleIntObjectReferenceArrayMap<T> implements TripleIntObjectMap<T
4949 private final LinkedHashSet <T > values ;
5050 private final LinkedHashSet <LeafEntry > leafEntries ;
5151 private final AtomicReference <Collection <T >> valuesSnapshot = new AtomicReference <>(null );
52- private int removed = 0 ;
5352
5453 public TripleIntObjectReferenceArrayMap (int bits ) {
5554 this (bits , 1 );
@@ -67,7 +66,6 @@ private TripleIntObjectReferenceArrayMap(int bits, int depth) {
6766 this .leafEntries = new LinkedHashSet <>();
6867 }
6968
70- @ Override
7169 public T get (int x , int y , int z ) {
7270 Entry <T > entry = getEntryRaw (x , y , z );
7371 if (entry != null ) {
@@ -77,14 +75,12 @@ public T get(int x, int y, int z) {
7775 }
7876 }
7977
80- @ Override
8178 public synchronized T remove (int x , int y , int z ) {
8279 Entry <T > entry = getEntryRaw (x , y , z );
8380 if (entry != null ) {
8481 T value = entry .remove ();
8582 if (value != null ) {
8683 valuesSnapshot .set (null );
87- removed ++;
8884 if (!values .remove (value )) {
8985 throw new IllegalStateException ("Item removed from map was not in item set" );
9086 }
@@ -95,14 +91,12 @@ public synchronized T remove(int x, int y, int z) {
9591 }
9692 }
9793
98- @ Override
9994 public synchronized boolean remove (int x , int y , int z , T value ) {
10095 Entry <T > entry = getEntryRaw (x , y , z );
10196 if (entry != null ) {
10297 boolean b = entry .remove (value );
10398 if (b ) {
10499 valuesSnapshot .set (null );
105- removed ++;
106100 if (!values .remove (value )) {
107101 throw new IllegalStateException ("Item removed from map was not in item set" );
108102 }
@@ -113,7 +107,6 @@ public synchronized boolean remove(int x, int y, int z, T value) {
113107 }
114108 }
115109
116- @ Override
117110 public synchronized T put (int x , int y , int z , T value ) {
118111 if (value == null ) {
119112 throw new NullPointerException ("Null values are not permitted" );
@@ -136,7 +129,6 @@ public synchronized T put(int x, int y, int z, T value) {
136129 }
137130 }
138131
139- @ Override
140132 public synchronized T putIfAbsent (int x , int y , int z , T value ) {
141133 if (value == null ) {
142134 throw new NullPointerException ("Null values are not permitted" );
@@ -156,7 +148,6 @@ public synchronized T putIfAbsent(int x, int y, int z, T value) {
156148 }
157149 }
158150
159- @ Override
160151 public Collection <T > valueCollection () {
161152 Collection <T > newValues = this .valuesSnapshot .get ();
162153 if (newValues != null ) {
0 commit comments