Package org.biojavax
Class SimpleNamespace
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojavax.SimpleNamespace
- All Implemented Interfaces:
Comparable
,Changeable
,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
ConstructorsModifierConstructorDescriptionprotected
SimpleNamespace
(String name) Creates a new instance of SimpleNamespace with the given name, which cannot be null. -
Method Summary
Modifier and TypeMethodDescriptionint
Namespaces are compared only by name.boolean
Namespaces are equal only by name.If the namespace has an acronym, this will return it.This method will return the authority that governs the namespace.Returns a description of this namespace.getId()
Gets the Hibernate ID.getName()
The name of the namespace is immutable and must be set by the constructor of the instantiating class.getURI()
If the namespace has a URI, this will return it.int
hashCode()
void
setAcronym
(String acronym) Sets an optional acronym for the namespace.void
setAuthority
(String authority) This method sets the authority that governs the namespace.void
setDescription
(String description) This method sets a description for the namespace.void
Sets the Hibernate ID.void
Sets an optional URI for the namespace.toString()
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
-
Constructor Details
-
SimpleNamespace
Creates a new instance of SimpleNamespace with the given name, which cannot be null.- Parameters:
name
- the name of the namespace.
-
SimpleNamespace
protected SimpleNamespace()
-
-
Method Details
-
setAcronym
Sets 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:
setAcronym
in interfaceNamespace
- Parameters:
acronym
- the acronym for the namespace.- Throws:
ChangeVetoException
- in case of objections.
-
setAuthority
This method sets the authority that governs the namespace. Null will unset it.- Specified by:
setAuthority
in interfaceNamespace
- Parameters:
authority
- the name of the namespace authority.- Throws:
ChangeVetoException
- in case of objections.
-
setDescription
This method sets a description for the namespace. Null will unset it.- Specified by:
setDescription
in interfaceNamespace
- Parameters:
description
- the description of the namespace.- Throws:
ChangeVetoException
- in case of objections.
-
setURI
Sets 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:
setURI
in interfaceNamespace
- Parameters:
URI
- the URI of the authority.- Throws:
ChangeVetoException
- in case of objections.
-
getAcronym
If the namespace has an acronym, this will return it.- Specified by:
getAcronym
in interfaceNamespace
- Returns:
- the acronym for the namespace.
-
getAuthority
This method will return the authority that governs the namespace.- Specified by:
getAuthority
in interfaceNamespace
- Returns:
- the name of the namespace authority.
-
getDescription
Returns a description of this namespace.- Specified by:
getDescription
in interfaceNamespace
- Returns:
- the description of the namespace.
-
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
If the namespace has a URI, this will return it. -
compareTo
Namespaces are compared only by name.- Specified by:
compareTo
in interfaceComparable
-
equals
Namespaces are equal only by name. -
hashCode
-
toString
Form: "name" -
getId
Gets the Hibernate ID. Should be used with caution.- Returns:
- the Hibernate ID, if using Hibernate.
-
setId
Sets the Hibernate ID. Should be used with caution.- Parameters:
id
- the Hibernate ID, if using Hibernate.
-