org.knopflerfish.framework
Class FilterImpl

java.lang.Object
  extended by org.knopflerfish.framework.FilterImpl
All Implemented Interfaces:
Filter

public class FilterImpl
extends java.lang.Object
implements Filter


Constructor Summary
FilterImpl(java.lang.String filter)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this Filter object to another object.
 int hashCode()
          Returns the hashCode for this Filter object.
 boolean match(java.util.Dictionary dictionary)
          Filter using a Dictionary object.
 boolean match(ServiceReference reference)
          Filter using a service's properties.
 boolean matchCase(java.util.Dictionary dictionary)
          Filter with case sensitivity using a Dictionary object.
 java.lang.String toString()
          Returns this Filter object's filter string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterImpl

public FilterImpl(java.lang.String filter)
           throws InvalidSyntaxException
Throws:
InvalidSyntaxException
Method Detail

match

public boolean match(ServiceReference reference)
Description copied from interface: Filter
Filter using a service's properties.

The filter is executed using the keys and values of the referenced service's properties. The keys are case insensitively matched with the filter.

Specified by:
match in interface Filter
Parameters:
reference - The reference to the service whose properties are used in the match.
Returns:
true if the service's properties match this filter; false otherwise.

match

public boolean match(java.util.Dictionary dictionary)
Description copied from interface: Filter
Filter using a Dictionary object. The Filter is executed using the Dictionary object's keys and values. The keys are case insensitively matched with the filter.

Specified by:
match in interface Filter
Parameters:
dictionary - The Dictionary object whose keys are used in the match.
Returns:
true if the Dictionary object's keys and values match this filter; false otherwise.

matchCase

public boolean matchCase(java.util.Dictionary dictionary)
Description copied from interface: Filter
Filter with case sensitivity using a Dictionary object. The Filter is executed using the Dictionary object's keys and values. The keys are case sensitively matched with the filter.

Specified by:
matchCase in interface Filter
Parameters:
dictionary - The Dictionary object whose keys are used in the match.
Returns:
true if the Dictionary object's keys and values match this filter; false otherwise.

toString

public java.lang.String toString()
Description copied from interface: Filter
Returns this Filter object's filter string.

The filter string is normalized by removing whitespace which does not affect the meaning of the filter.

Specified by:
toString in interface Filter
Overrides:
toString in class java.lang.Object
Returns:
Filter string.

equals

public boolean equals(java.lang.Object obj)
Description copied from interface: Filter
Compares this Filter object to another object.

Specified by:
equals in interface Filter
Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare against this Filter object.
Returns:
If the other object is a Filter object, then returns this.toString().equals(obj.toString();false otherwise.

hashCode

public int hashCode()
Description copied from interface: Filter
Returns the hashCode for this Filter object.

Specified by:
hashCode in interface Filter
Overrides:
hashCode in class java.lang.Object
Returns:
The hashCode of the filter string; that is, this.toString().hashCode().