Package org.biojavax

Class SimpleNamespace

All Implemented Interfaces:
Comparable, Changeable, Namespace

public class SimpleNamespace extends AbstractChangeable implements Namespace
A basic Namespace implemenation.
Since:
1.5
Author:
Richard Holland, Mark Schreiber
  • Constructor Details

    • SimpleNamespace

      public SimpleNamespace(String name)
      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

      public void setAcronym(String acronym) throws ChangeVetoException
      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 interface Namespace
      Parameters:
      acronym - the acronym for the namespace.
      Throws:
      ChangeVetoException - in case of objections.
    • setAuthority

      public void setAuthority(String authority) throws ChangeVetoException
      This method sets the authority that governs the namespace. Null will unset it.
      Specified by:
      setAuthority in interface Namespace
      Parameters:
      authority - the name of the namespace authority.
      Throws:
      ChangeVetoException - in case of objections.
    • setDescription

      public void setDescription(String description) throws ChangeVetoException
      This method sets a description for the namespace. Null will unset it.
      Specified by:
      setDescription in interface Namespace
      Parameters:
      description - the description of the namespace.
      Throws:
      ChangeVetoException - in case of objections.
    • setURI

      public void setURI(URI URI) throws ChangeVetoException
      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 interface Namespace
      Parameters:
      URI - the URI of the authority.
      Throws:
      ChangeVetoException - in case of objections.
    • getAcronym

      public String getAcronym()
      If the namespace has an acronym, this will return it.
      Specified by:
      getAcronym in interface Namespace
      Returns:
      the acronym for the namespace.
    • getAuthority

      public String getAuthority()
      This method will return the authority that governs the namespace.
      Specified by:
      getAuthority in interface Namespace
      Returns:
      the name of the namespace authority.
    • getDescription

      Returns a description of this namespace.
      Specified by:
      getDescription in interface Namespace
      Returns:
      the description of the namespace.
    • getName

      public 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.
      Specified by:
      getName in interface Namespace
      Returns:
      The name of the namespace.
    • getURI

      public URI getURI()
      If the namespace has a URI, this will return it.
      Specified by:
      getURI in interface Namespace
      Returns:
      the URI of the authority.
    • compareTo

      public int compareTo(Object o)
      Namespaces are compared only by name.
      Specified by:
      compareTo in interface Comparable
    • equals

      public boolean equals(Object obj)
      Namespaces are equal only by name.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Form: "name"
      Overrides:
      toString in class Object
    • getId

      public Integer getId()
      Gets the Hibernate ID. Should be used with caution.
      Returns:
      the Hibernate ID, if using Hibernate.
    • setId

      public void setId(Integer id)
      Sets the Hibernate ID. Should be used with caution.
      Parameters:
      id - the Hibernate ID, if using Hibernate.