[New] Added ObjectFilter.isEmpty()

This commit is contained in:
Robert von Burg 2016-09-05 11:58:46 +02:00
parent 916f927ccd
commit a4e63b7de0
1 changed files with 15 additions and 6 deletions

View File

@ -88,8 +88,8 @@ public class ObjectFilter {
* Default constructor initializing the filter
*/
public ObjectFilter() {
this.cache = new HashMap<>();
this.keySet = new HashSet<>();
this.cache = new HashMap<>(1);
this.keySet = new HashSet<>(1);
}
/**
@ -179,7 +179,8 @@ public class ObjectFilter {
}
/**
* Register, under the given key, the update of the given object. * </p>
* Register, under the given key, the update of the given object. *
* </p>
* <table border="1">
* <tr>
* <td>Action \ State in Cache</td>
@ -248,7 +249,8 @@ public class ObjectFilter {
}
/**
* Register, under the given key, the removal of the given object. * </p>
* Register, under the given key, the removal of the given object. *
* </p>
* <table border="1">
* <tr>
* <td>Action \ State in Cache</td>
@ -679,6 +681,13 @@ public class ObjectFilter {
return this.cache.size();
}
/**
* @return true if the cache is empty, false otherwise
*/
public boolean isEmpty() {
return this.cache.size() == 0;
}
/**
* @return get a unique transaction ID
*/