parent
f8dc8523da
commit
3d502d90e2
|
|
@ -55,10 +55,13 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
|
|
||||||
private final Locale locale;
|
private final Locale locale;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private transient Set<String> keySet;
|
private transient Set<String> keySet;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private transient Collection<V> values;
|
private transient Collection<V> values;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private transient Set<Entry<String, V>> entrySet;
|
private transient Set<Entry<String, V>> entrySet;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -320,6 +323,7 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private String removeCaseInsensitiveKey(String key) {
|
private String removeCaseInsensitiveKey(String key) {
|
||||||
return this.caseInsensitiveKeys.remove(convertKey(key));
|
return this.caseInsensitiveKeys.remove(convertKey(key));
|
||||||
}
|
}
|
||||||
|
|
@ -329,12 +333,10 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
|
|
||||||
private final Set<String> delegate;
|
private final Set<String> delegate;
|
||||||
|
|
||||||
|
|
||||||
KeySet(Set<String> delegate) {
|
KeySet(Set<String> delegate) {
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return this.delegate.size();
|
return this.delegate.size();
|
||||||
|
|
@ -369,7 +371,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
public void forEach(Consumer<? super String> action) {
|
public void forEach(Consumer<? super String> action) {
|
||||||
this.delegate.forEach(action);
|
this.delegate.forEach(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -377,12 +378,10 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
|
|
||||||
private final Collection<V> delegate;
|
private final Collection<V> delegate;
|
||||||
|
|
||||||
|
|
||||||
Values(Collection<V> delegate) {
|
Values(Collection<V> delegate) {
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return this.delegate.size();
|
return this.delegate.size();
|
||||||
|
|
@ -412,7 +411,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
public void forEach(Consumer<? super V> action) {
|
public void forEach(Consumer<? super V> action) {
|
||||||
this.delegate.forEach(action);
|
this.delegate.forEach(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -420,12 +418,10 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
|
|
||||||
private final Set<Entry<String, V>> delegate;
|
private final Set<Entry<String, V>> delegate;
|
||||||
|
|
||||||
|
|
||||||
public EntrySet(Set<Entry<String, V>> delegate) {
|
public EntrySet(Set<Entry<String, V>> delegate) {
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int size() {
|
public int size() {
|
||||||
return this.delegate.size();
|
return this.delegate.size();
|
||||||
|
|
@ -441,7 +437,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
return new EntrySetIterator();
|
return new EntrySetIterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public boolean remove(Object o) {
|
public boolean remove(Object o) {
|
||||||
|
|
@ -452,7 +447,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void clear() {
|
public void clear() {
|
||||||
this.delegate.clear();
|
this.delegate.clear();
|
||||||
|
|
@ -468,7 +462,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
public void forEach(Consumer<? super Entry<String, V>> action) {
|
public void forEach(Consumer<? super Entry<String, V>> action) {
|
||||||
this.delegate.forEach(action);
|
this.delegate.forEach(action);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -476,6 +469,7 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
|
|
||||||
private final Iterator<Entry<String, V>> delegate;
|
private final Iterator<Entry<String, V>> delegate;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
private Entry<String, V> last;
|
private Entry<String, V> last;
|
||||||
|
|
||||||
public EntryIterator() {
|
public EntryIterator() {
|
||||||
|
|
@ -494,12 +488,11 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
|
|
||||||
public void remove() {
|
public void remove() {
|
||||||
this.delegate.remove();
|
this.delegate.remove();
|
||||||
if(this.last != null) {
|
if (this.last != null) {
|
||||||
removeCaseInsensitiveKey(this.last.getKey());
|
removeCaseInsensitiveKey(this.last.getKey());
|
||||||
this.last = null;
|
this.last = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -509,7 +502,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
public String next() {
|
public String next() {
|
||||||
return nextEntry().getKey();
|
return nextEntry().getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -519,7 +511,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
public V next() {
|
public V next() {
|
||||||
return nextEntry().getValue();
|
return nextEntry().getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -529,7 +520,6 @@ public class LinkedCaseInsensitiveMap<V> implements Map<String, V>, Serializable
|
||||||
public Entry<String, V> next() {
|
public Entry<String, V> next() {
|
||||||
return nextEntry();
|
return nextEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue