Package org.biojavax
Class SimpleNamespace
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojavax.SimpleNamespace
-
- All Implemented Interfaces:
java.lang.Comparable,Changeable,Namespace
public class SimpleNamespace extends AbstractChangeable implements Namespace
A basic Namespace implemenation.- Since:
- 1.5
- Author:
- Richard Holland, Mark Schreiber
-
-
Field Summary
-
Fields inherited from interface org.biojavax.Namespace
ACRONYM, AUTHORITY, DESCRIPTION, NAME
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleNamespace()SimpleNamespace(java.lang.String name)Creates a new instance of SimpleNamespace with the given name, which cannot be null.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(java.lang.Object o)Namespaces are compared only by name.booleanequals(java.lang.Object obj)Namespaces are equal only by name.java.lang.StringgetAcronym()If the namespace has an acronym, this will return it.java.lang.StringgetAuthority()This method will return the authority that governs the namespace.java.lang.StringgetDescription()Returns a description of this namespace.java.lang.IntegergetId()Gets the Hibernate ID.java.lang.StringgetName()The name of the namespace is immutable and must be set by the constructor of the instantiating class.java.net.URIgetURI()If the namespace has a URI, this will return it.inthashCode()voidsetAcronym(java.lang.String acronym)Sets an optional acronym for the namespace.voidsetAuthority(java.lang.String authority)This method sets the authority that governs the namespace.voidsetDescription(java.lang.String description)This method sets a description for the namespace.voidsetId(java.lang.Integer id)Sets the Hibernate ID.voidsetURI(java.net.URI URI)Sets an optional URI for the namespace.java.lang.StringtoString()Form: "name"-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Method Detail
-
setAcronym
public void setAcronym(java.lang.String acronym) throws ChangeVetoExceptionSets an optional acronym for the namespace. Null will unset it. Note that in BioSQL 1.0 Acronym is only part of the Oracle schema therefore it will only be persisted in that schema.- Specified by:
setAcronymin interfaceNamespace- Parameters:
acronym- the acronym for the namespace.- Throws:
ChangeVetoException- in case of objections.
-
setAuthority
public void setAuthority(java.lang.String authority) throws ChangeVetoExceptionThis method sets the authority that governs the namespace. Null will unset it.- Specified by:
setAuthorityin interfaceNamespace- Parameters:
authority- the name of the namespace authority.- Throws:
ChangeVetoException- in case of objections.
-
setDescription
public void setDescription(java.lang.String description) throws ChangeVetoExceptionThis method sets a description for the namespace. Null will unset it.- Specified by:
setDescriptionin interfaceNamespace- Parameters:
description- the description of the namespace.- Throws:
ChangeVetoException- in case of objections.
-
setURI
public void setURI(java.net.URI URI) throws ChangeVetoExceptionSets an optional URI for the namespace. Null will unset it. Note that in BioSQL 1.0 URI is not persisted into the database unless the extended Oracle schema is used.- Specified by:
setURIin interfaceNamespace- Parameters:
URI- the URI of the authority.- Throws:
ChangeVetoException- in case of objections.
-
getAcronym
public java.lang.String getAcronym()
If the namespace has an acronym, this will return it.- Specified by:
getAcronymin interfaceNamespace- Returns:
- the acronym for the namespace.
-
getAuthority
public java.lang.String getAuthority()
This method will return the authority that governs the namespace.- Specified by:
getAuthorityin interfaceNamespace- Returns:
- the name of the namespace authority.
-
getDescription
public java.lang.String getDescription()
Returns a description of this namespace.- Specified by:
getDescriptionin interfaceNamespace- Returns:
- the description of the namespace.
-
getName
public java.lang.String getName()
The name of the namespace is immutable and must be set by the constructor of the instantiating class. The name should also be unique. This method will return the name.
-
getURI
public java.net.URI getURI()
If the namespace has a URI, this will return it.
-
compareTo
public int compareTo(java.lang.Object o)
Namespaces are compared only by name.- Specified by:
compareToin interfacejava.lang.Comparable
-
equals
public boolean equals(java.lang.Object obj)
Namespaces are equal only by name.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Form: "name"- Overrides:
toStringin classjava.lang.Object
-
getId
public java.lang.Integer getId()
Gets the Hibernate ID. Should be used with caution.- Returns:
- the Hibernate ID, if using Hibernate.
-
setId
public void setId(java.lang.Integer id)
Sets the Hibernate ID. Should be used with caution.- Parameters:
id- the Hibernate ID, if using Hibernate.
-
-