org.cdmckay.coffeedom.filter
Class ElementFilter

java.lang.Object
  extended by org.cdmckay.coffeedom.filter.AbstractFilter
      extended by org.cdmckay.coffeedom.filter.ElementFilter
All Implemented Interfaces:
Serializable, Filter

public class ElementFilter
extends AbstractFilter

A Filter that only matches Element objects.

Author:
Jools Enticknap, Bradley S. Huffman
See Also:
Serialized Form

Constructor Summary
ElementFilter()
          Select only the Elements.
ElementFilter(Namespace namespace)
          Select only the Elements with the supplied Namespace.
ElementFilter(String name)
          Select only the Elements with the supplied name in any Namespace.
ElementFilter(String name, Namespace namespace)
          Select only the Elements with the supplied name and Namespace.
 
Method Summary
 boolean equals(Object object)
          Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).
 int hashCode()
           
 boolean matches(Object object)
          Check to see if the object matches a predefined set of rules.
 
Methods inherited from class org.cdmckay.coffeedom.filter.AbstractFilter
and, negate, or
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementFilter

public ElementFilter()
Select only the Elements.


ElementFilter

public ElementFilter(String name)
Select only the Elements with the supplied name in any Namespace.

Parameters:
name - The name of the Element.

ElementFilter

public ElementFilter(Namespace namespace)
Select only the Elements with the supplied Namespace.

Parameters:
namespace - The namespace the Element lives in.

ElementFilter

public ElementFilter(String name,
                     Namespace namespace)
Select only the Elements with the supplied name and Namespace.

Parameters:
name - The name of the Element.
namespace - The namespace the Element lives in.
Method Detail

matches

public boolean matches(Object object)
Check to see if the object matches a predefined set of rules.

Parameters:
object - The object to verify.
Returns:
true if the objected matched a predefined set of rules.

equals

public boolean equals(Object object)
Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).

Overrides:
equals in class Object
Parameters:
object - the object to compare against
Returns:
whether the two filters are equal

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2011. All Rights Reserved.