com.wewebu.ow.server.fieldimpl.filter
Class OwAbstractComparator<T>

java.lang.Object
  extended by com.wewebu.ow.server.fieldimpl.filter.OwAbstractComparator<T>
All Implemented Interfaces:
OwComparator<T>
Direct Known Subclasses:
OwBoolComparator, OwDateComparator, OwNumberComparator, OwStringComparator

public abstract class OwAbstractComparator<T>
extends Object
implements OwComparator<T>

Abstract comparator implementation. Provides a process to implement only the operation depending functionality, and automatically negation if NOT operation.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com

Since:
3.2.0.0

Constructor Summary
OwAbstractComparator()
           
 
Method Summary
 boolean match(OwSearchCriteria filter, T value)
          Matching check, where the filter specifies the criteria value and operation to be used for filtering.
protected abstract  boolean matchBetween(OwSearchCriteria filter, T value)
          Between value compare, where both limits must be include for comparison. Neither the minimum limit nor the maximum limit should be excluded.
protected abstract  boolean matchEquals(OwSearchCriteria filter, T value)
          Value and filter value must be equal! But equal operation is depending on the type and restriction of the given value.
protected abstract  boolean matchGreater(OwSearchCriteria filter, T value)
          Value restriction where it must be greater as the filter.
protected abstract  boolean matchGreaterEquals(OwSearchCriteria filter, T value)
          Greater or equals compare of given value and filter.
protected abstract  boolean matchLess(OwSearchCriteria filter, T value)
          Value must be less than the defined filter.
protected abstract  boolean matchLessEquals(OwSearchCriteria filter, T value)
          Less or equals compare of the value and filter.
protected abstract  boolean matchLike(OwSearchCriteria filter, T value)
          A like compare of the value, the filter criteria can be used to get the representation of wildcard characters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OwAbstractComparator

public OwAbstractComparator()
Method Detail

match

public boolean match(OwSearchCriteria filter,
                     T value)
Description copied from interface: OwComparator
Matching check, where the filter specifies the criteria value and operation to be used for filtering.

Specified by:
match in interface OwComparator<T>
Parameters:
filter - OwSearchCriteria
value - T to verify against filter
Returns:
true only if value is matching the filter, else false

matchBetween

protected abstract boolean matchBetween(OwSearchCriteria filter,
                                        T value)
Between value compare, where both limits must be include for comparison. Neither the minimum limit nor the maximum limit should be excluded.

Parameters:
filter - OwSearchCriteria providing the limit(s)
value - T to match with criteria
Returns:
boolean if matches criteria

matchLessEquals

protected abstract boolean matchLessEquals(OwSearchCriteria filter,
                                           T value)
Less or equals compare of the value and filter.

Parameters:
filter - OwSearchCriteria to restrict value
value - T to match against filter
Returns:
boolean if matches criteria

matchGreaterEquals

protected abstract boolean matchGreaterEquals(OwSearchCriteria filter,
                                              T value)
Greater or equals compare of given value and filter.

Parameters:
filter - OwSearchCriteria to restrict value
value - T to match against filter
Returns:
boolean if matches criteria

matchLess

protected abstract boolean matchLess(OwSearchCriteria filter,
                                     T value)
Value must be less than the defined filter.

Parameters:
filter - OwSearchCriteria to restrict value
value - T to match against filter
Returns:
boolean if matches criteria

matchGreater

protected abstract boolean matchGreater(OwSearchCriteria filter,
                                        T value)
Value restriction where it must be greater as the filter.

Parameters:
filter - OwSearchCriteria to restrict value
value - T to match against filter
Returns:
boolean if matches criteria

matchLike

protected abstract boolean matchLike(OwSearchCriteria filter,
                                     T value)
A like compare of the value, the filter criteria can be used to get the representation of wildcard characters.

Parameters:
filter - OwSearchCriteria to restrict value
value - T to match against filter
Returns:
boolean if matches criteria

matchEquals

protected abstract boolean matchEquals(OwSearchCriteria filter,
                                       T value)
Value and filter value must be equal! But equal operation is depending on the type and restriction of the given value.

For special cases (Date, Number,...) an equal compare will still return true even if the filter and given value not match fully each other .

Parameters:
filter - OwSearchCriteria to restrict value
value - T to match against filter
Returns:
boolean if matches criteria


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.