Top Description Fields Constructors Methods
org.jdom.filter

public Class ElementFilter

extends AbstractFilter
Class Inheritance
Imports
java.io.*, org.jdom.*

A Filter that only matches org.jdom.Element objects.
Authors
Jools Enticknap, Bradley S. Huffman
Version
$Revision: 1.20 $, $Date: 2007/11/10 05:29:00 $

Field Summary

Modifier and TypeField and Description
private static final String
private String
name

The element name

private transient Namespace
namespace

The element namespace

Constructor Summary

AccessConstructor and Description
public
ElementFilter()

Select only the Elements.

public
ElementFilter(String
The name of the Element.
name
)

Select only the Elements with the supplied name in any Namespace.

public
ElementFilter(Namespace
The namespace the Element lives in.
namespace
)

Select only the Elements with the supplied Namespace.

public
ElementFilter(String
The name of the Element.
name
,
Namespace
The namespace the Element lives in.
namespace
)

Select only the Elements with the supplied name and Namespace.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether the two filters are equal
equals
(Object
the object to compare against
obj
)

Overrides java.lang.Object.equals.

Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean

Returns:

true if the objected matched a predfined set of rules.
matches
(Object
The object to verify.
obj
)

Implements org.jdom.filter.Filter.matches.

Check to see if the object matches a predefined set of rules.
private void
private void
Inherited from org.jdom.filter.AbstractFilter:
andnegateor

Field Detail

CVS_IDback to summary
private static final String CVS_ID

Hides org.jdom.filter.AbstractFilter.CVS_ID.

nameback to summary
private String name

The element name

namespaceback to summary
private transient Namespace namespace

The element namespace

Constructor Detail

ElementFilterback to summary
public ElementFilter()

Select only the Elements.

ElementFilterback to summary
public ElementFilter(String name)

Select only the Elements with the supplied name in any Namespace.

Parameters
name:String

The name of the Element.

ElementFilterback to summary
public ElementFilter(Namespace namespace)

Select only the Elements with the supplied Namespace.

Parameters
namespace:Namespace

The namespace the Element lives in.

ElementFilterback to summary
public ElementFilter(String name, Namespace namespace)

Select only the Elements with the supplied name and Namespace.

Parameters
name:String

The name of the Element.

namespace:Namespace

The namespace the Element lives in.

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Returns whether the two filters are equivalent (i.e. the matching names and namespace are equivalent).

Parameters
obj:Object

the object to compare against

Returns:boolean

whether the two filters are equal

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

matchesback to summary
public boolean matches(Object obj)

Implements org.jdom.filter.Filter.matches.

Check to see if the object matches a predefined set of rules.

Parameters
obj:Object

The object to verify.

Returns:boolean

true if the objected matched a predfined set of rules.

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException