## org.biojava.bio.seq
Class FeatureTypes.RepositoryImpl

    java.lang.Object
      org.biojava.utils.AbstractChangeable
          org.biojava.bio.seq.FeatureTypes.RepositoryImpl

All Implemented Interfaces:
  Annotatable, FeatureTypes.Repository, Changeable

Enclosing class:
  FeatureTypes

    public static class FeatureTypes.RepositoryImpl

extends AbstractChangeable
implements FeatureTypes.Repository

A simple implementation of a Repository.

Since:
  1.3
Author:
  Matthew Pocock

Nested Class Summary

Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
`Annotatable.AnnotationForwarder`

Field Summary

Fields inherited from interface org.biojava.bio.Annotatable
`ANNOTATION`

Constructor Summary
`FeatureTypes.RepositoryImpl(String name)` Create a named repository.

Method Summary
`FeatureTypes.Type` `createType(String name, FeatureFilter schema, Set parents)` Create a new type in this repository.
`Annotation` `getAnnotation()` Should return the associated annotation object.
`protected ChangeSupport` `getChangeSupport(ChangeType ct)` Called to retrieve the ChangeSupport for this object.
`String` `getName()` The name of this repository.
`FeatureTypes.Type` `getType(String name)` Find the type for a name.
`Set` `getTypes()` Get a set of all type names defined in this repository.

Methods inherited from class org.biojava.utils.AbstractChangeable
`addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Constructor Detail

### FeatureTypes.RepositoryImpl

    public FeatureTypes.RepositoryImpl(String name)

  Create a named repository.

  Parameters:
    `name` - the name of this repository

Method Detail

### getChangeSupport

    protected ChangeSupport getChangeSupport(ChangeType ct)

  Description copied from class: `AbstractChangeable`
  Called to retrieve the ChangeSupport for this object.

  Your implementation of this method should have the following structure: ``

       ChangeSupport cs = super.getChangeSupport(ct);

       if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
         someForwarder = new ChangeForwarder(...

         this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
       }

       return cs;

  It is usual for the forwarding listeners (someForwarder in this example) to be transient and lazily instantiated. Be sure to register & unregister the forwarder in the code that does the ChangeEvent handling in setter methods.

  Overrides:
    `getChangeSupport` in class `AbstractChangeable`

### getAnnotation

    public Annotation getAnnotation()

  Description copied from interface: `Annotatable`
  Should return the associated annotation object.

  Specified by:
    `getAnnotation` in interface `Annotatable`
  Returns:
    an Annotation object, never null

### getName

    public String getName()

  Description copied from interface: `FeatureTypes.Repository`

  The name of this repository.

  This will be the ${repository} component of any URIs of types defined here.

  Specified by:
    `getName` in interface `FeatureTypes.Repository`
  Returns:
    the name of the repository

### getTypes

    public Set getTypes()

  Description copied from interface: `FeatureTypes.Repository`
  Get a set of all type names defined in this repository.

  Specified by:
    `getTypes` in interface `FeatureTypes.Repository`
  Returns:
    a Set of Type names as Strings

### getType

    public FeatureTypes.Type getType(String name)
                              throws NoSuchElementException

  Description copied from interface: `FeatureTypes.Repository`
  Find the type for a name.

  Specified by:
    `getType` in interface `FeatureTypes.Repository`
  Parameters:
    `name` - the name of the Type
  Returns:
    the Type of that name
  Throws:
    `NoSuchElementException` - if that type can not be found

### createType

    public FeatureTypes.Type createType(String name,
                                        FeatureFilter schema,
                                        Set parents)

  Create a new type in this repository.

  Parameters:
    `name` - the Type name
    `schema` - the FeatureFilter defining the type
    `parents` - the Set (possibly empty) of parent URIs