net.refractions.udig.ui.operations
Interface PropertyValue<T>

All Known Implementing Classes:
AbstractPropertyValue

public interface PropertyValue<T>

Determines whether a property value is true or false given an object.

This class is must be implemented by objectProperty extensions to teach the system new properties for objects.

You can compare this to the idea of "core expressions" introduced to the RCP platform in eclipse. This is something like a core expression that can only be a Boolean.

Since:
1.1.0
Author:
jones

Method Summary
 void addListener(IOpFilterListener listener)
          Adds a listener to listen for events indicating the value has changed.
 boolean canCacheResult()
          Returns true if the results can be cached.
 boolean isBlocking()
          Returns true if processing this filter may block when #accept(Object) is called.
 boolean isTrue(T object, java.lang.String value)
          Returns true if the value provided is a legal value for the object.
 void removeListener(IOpFilterListener listener)
          Removes a listeners
 

Method Detail

isTrue

boolean isTrue(T object,
               java.lang.String value)
Returns true if the value provided is a legal value for the object. The subclass determines what are legal values.

Parameters:
object - the object that will be used to determine if the value is legal
value - an arbitrary string.
Returns:
Returns true if the value provided is a legal value for the object.

canCacheResult

boolean canCacheResult()
Returns true if the results can be cached. A result can be cached if
  1. The value will never change
  2. It is possible for the filter to listen for changes and update listeners added via the addListener(IOpFilterListener) method
Therefore this method only returns false if it must be calculated each time because there is no way to listen for state changes. If it is non-blocking that is fine, if it is blocking then try to do this rarely.

Returns:
true if the results can be cached.

isBlocking

boolean isBlocking()
Returns true if processing this filter may block when #accept(Object) is called.

Returns:
true if processing this filter may block when #accept(Object) is called.

addListener

void addListener(IOpFilterListener listener)
Adds a listener to listen for events indicating the value has changed.

Parameters:
listener - listener to add

removeListener

void removeListener(IOpFilterListener listener)
Removes a listeners

Parameters:
listener - listener to remove