FileDocCategorySizeDatePackage
GOMNamespace.javaAPI DocApache Lucene 2.1.04063Wed Feb 14 10:46:00 GMT 2007org.apache.lucene.gdata.gom

GOMNamespace

public final class GOMNamespace extends Object
A simple domain object to represent a xml namespace.
author
Simon Willnauer

Fields Summary
public static final String
XML_NS_URI
XML namespace uri
public static final String
XML_NS_PREFIX
XML namespace prefix
public static final String
OPENSEARCH_NS_PREFIX
Amazon "opensearch" namespace prefix
public static final String
OPENSEARCH_NS_URI
Amazon "opensearch" namespace uri
public static final String
ATOM_NS_URI
ATOM namespace uri
public static final String
ATOM_NS_PREFIX
ATOM namespace prefix
public static final GOMNamespace
ATOM_NAMESPACE
ATOM namespace
public static final GOMNamespace
OPENSEARCH_NAMESPACE
Amazon "opensearch" namespace
private final String
namespaceUri
private final String
namespacePrefix
Constructors Summary
public GOMNamespace(String aNamespaceUri, String aNamespacePrefix)
Class constructor for GOMNamespace

param
aNamespaceUri - the namespace uri (must not be null)
param
aNamespacePrefix - the namespace prefix (if null an empty string will be assigned)


	                                                               	 
	   
			   
		if (aNamespaceUri == null)
			throw new IllegalArgumentException("uri must not be null");
		this.namespacePrefix = aNamespacePrefix == null ? "" : aNamespacePrefix;
		this.namespaceUri = aNamespaceUri;
	
Methods Summary
public booleanequals(java.lang.Object arg0)

see
java.lang.Object#equals(java.lang.Object)

		if (arg0 == null)
			return false;
		if (arg0 == this)
			return true;
		if (arg0 instanceof GOMNamespace) {
			GOMNamespace other = (GOMNamespace) arg0;
			return this.namespacePrefix.equals(other.getNamespacePrefix())
					&& this.namespaceUri.equals(other.getNamespaceUri());
		}
		return false;
	
public java.lang.StringgetNamespacePrefix()

return
Returns the namespacePrefix.

		return this.namespacePrefix;
	
public java.lang.StringgetNamespaceUri()

return
Returns the namespaceUri.

		return this.namespaceUri;
	
public inthashCode()

see
java.lang.Object#hashCode()

		/*
		 * The multiplier 37 was chosen because it is an odd prime. If it was
		 * even and the multiplication overflowed, information would be lost
		 * because multiplication by two is equivalent to shifting The value 17
		 * is arbitrary. see
		 * http://java.sun.com/developer/Books/effectivejava/Chapter3.pdf
		 */
		int hash = 17;
		hash = 37 * hash + this.namespacePrefix.hashCode();
		hash = 37 * hash + this.namespaceUri.hashCode();
		return hash;
	
public java.lang.StringtoString()

see
java.lang.Object#toString()

		StringBuilder builder = new StringBuilder(this.getClass().getName());
		builder.append(" uri: ").append(this.namespaceUri);
		builder.append(" prefix: ").append(this.namespacePrefix);
		return builder.toString();