mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
fix build breakage due to missing isEmpty() methods
This commit is contained in:
parent
4611c89dbe
commit
fef3cddb9e
@ -45,6 +45,10 @@ public class Collections {
|
||||
synchronized (lock) { return collection.size(); }
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
public synchronized boolean contains(T e) {
|
||||
synchronized (lock) { return collection.contains(e); }
|
||||
}
|
||||
@ -77,7 +81,6 @@ public class Collections {
|
||||
public void addAll(Collection<T> c) {
|
||||
synchronized (lock) { ((Set<T>)collection).addAll(c); }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class SynchronizedIterator<T> implements Iterator<T> {
|
||||
|
@ -293,6 +293,10 @@ public class HashMap<K, V> implements Map<K, V> {
|
||||
return HashMap.this.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return HashMap.this.isEmpty();
|
||||
}
|
||||
|
||||
public void addAll(Collection<Entry<K, V>> c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@ -323,6 +327,10 @@ public class HashMap<K, V> implements Map<K, V> {
|
||||
return HashMap.this.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return HashMap.this.isEmpty();
|
||||
}
|
||||
|
||||
public boolean contains(K key) {
|
||||
return containsKey(key);
|
||||
}
|
||||
@ -354,6 +362,10 @@ public class HashMap<K, V> implements Map<K, V> {
|
||||
return HashMap.this.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return HashMap.this.isEmpty();
|
||||
}
|
||||
|
||||
public boolean contains(V value) {
|
||||
return containsValue(value);
|
||||
}
|
||||
|
@ -22,6 +22,10 @@ public class HashSet<T> implements Set<T> {
|
||||
return map.size();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return map.isEmpty();
|
||||
}
|
||||
|
||||
public boolean contains(T element) {
|
||||
return map.containsKey(element);
|
||||
}
|
||||
|
@ -63,6 +63,10 @@ public class TreeSet<T> implements Collection<T> {
|
||||
return size;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return size == 0;
|
||||
}
|
||||
|
||||
public boolean contains(T value) {
|
||||
return !set.find(new Cell(value, null)).fresh();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user