public class ObjectCollectionFilter<T> extends java.lang.Object implements ObjectFilter<T>
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEFAULT_USE_IDENTITY |
Constructor and Description |
---|
ObjectCollectionFilter(java.util.Collection<T> objects)
Initialize the new instance with some objects.
|
ObjectCollectionFilter(java.util.Collection<T> objects,
boolean identity)
Initialize the new instance with some objects.
|
ObjectCollectionFilter(T[] objects)
Initialize the new instance with some objects.
|
ObjectCollectionFilter(T[] objects,
boolean identity)
Initialize the new instance with some objects.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
getNegated() |
protected java.util.Collection<T> |
getObjectCollection() |
protected boolean |
getUseIdentity() |
boolean |
matches(T object)
Returns true if the given object is in the collection
|
void |
negate()
This method reverses the logic of the filter.
|
protected java.util.Collection<T> |
newCollection(int initialCapacity) |
protected void |
setNegated(boolean newValue) |
protected void |
setObjectCollection(java.util.Collection<T> newValue) |
protected void |
setUseIdentity(boolean newValue) |
protected static final boolean DEFAULT_USE_IDENTITY
public ObjectCollectionFilter(java.util.Collection<T> objects)
objects
- The object to keep in the filterpublic ObjectCollectionFilter(java.util.Collection<T> objects, boolean identity)
objects
- The object to keep in the filteridentity
- If true an identity comparison is done rather than equality checkpublic ObjectCollectionFilter(T[] objects)
objects
- The object to keep in the filterpublic ObjectCollectionFilter(T[] objects, boolean identity)
objects
- The object to keep in the filteridentity
- If true an identity comparison is done rather than equality checkpublic boolean matches(T object)
matches
in interface IObjectFilter<T>
object
- Any object or nullpublic void negate()
protected java.util.Collection<T> newCollection(int initialCapacity)
protected java.util.Collection<T> getObjectCollection()
protected void setObjectCollection(java.util.Collection<T> newValue)
protected boolean getUseIdentity()
protected void setUseIdentity(boolean newValue)
protected boolean getNegated()
protected void setNegated(boolean newValue)