org.entityfs.util.filter.entity
Class ReadLockedEntityFilter

java.lang.Object
  extended by org.entityfs.support.filter.AbstractConvenientFilter<EntityView>
      extended by org.entityfs.util.filter.entity.ReadLockedEntityFilter
All Implemented Interfaces:
Cloneable, EntityFilter, ConvenientFilter<EntityView>, Filter<EntityView>

public final class ReadLockedEntityFilter
extends AbstractConvenientFilter<EntityView>
implements EntityFilter

A filter that matches entities that are read locked by the current thread. Write locked entities are always read locked too, so this filter matches both read and write locked entities.

An instance of this class does not contain any mutable internal state. Use the singleton instances FILTER or NOT_FILTER instead of instantiating the class.

Since:
1.0
Author:
Karl Gustafsson
See Also:
LockedEntityFilter, WriteLockedEntityFilter

Field Summary
static ReadLockedEntityFilter FILTER
          Singleton filter instance.
static NotFilter<EntityView> NOT_FILTER
          Singleton instance for the inversed filter.
 
Constructor Summary
ReadLockedEntityFilter()
           
 
Method Summary
 boolean equals(Object o)
           
 int hashCode()
           
 boolean matches(EntityView ev)
          Does the filter match the object?
 ConvenientFilter<EntityView> not()
          Creates a filter that negates the result from this filter.
 String toString()
           
 
Methods inherited from class org.entityfs.support.filter.AbstractConvenientFilter
and, bitwiseNegate, isCase, or, xor
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

FILTER

public static final ReadLockedEntityFilter FILTER
Singleton filter instance. Use this instead of instantiating the class.


NOT_FILTER

public static final NotFilter<EntityView> NOT_FILTER
Singleton instance for the inversed filter. Use this instead of instantiating this class and inversing it.

Constructor Detail

ReadLockedEntityFilter

public ReadLockedEntityFilter()
Method Detail

matches

public boolean matches(EntityView ev)
Description copied from interface: Filter
Does the filter match the object?

Specified by:
matches in interface Filter<EntityView>
Parameters:
ev - The object to match.
Returns:
true if the filter matches the object.

not

public ConvenientFilter<EntityView> not()
Description copied from interface: ConvenientFilter
Creates a filter that negates the result from this filter.

A filter implementing this method is also recommended to implement a method called bitwiseNegate that delegates to this method. That makes it possible to negate the filter using the ~ operator in a Groovy script.

Specified by:
not in interface ConvenientFilter<EntityView>
Overrides:
not in class AbstractConvenientFilter<EntityView>
Returns:
A filter that negates the result from this filter.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object