public static class FeatureTypes.RepositoryImpl extends AbstractChangeable implements FeatureTypes.Repository
Annotatable.AnnotationForwarder
ANNOTATION
Constructor and Description |
---|
FeatureTypes.RepositoryImpl(String name)
Create a named repository.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public FeatureTypes.RepositoryImpl(String name)
name
- the name of this repositoryprotected ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
Your implementation of this method should have the following structure:
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.
ChangeSupport cs = super.getChangeSupport(ct);
if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
someForwarder = new ChangeForwarder(...
this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
}
return cs;
getChangeSupport
in class AbstractChangeable
public Annotation getAnnotation()
Annotatable
getAnnotation
in interface Annotatable
public String getName()
FeatureTypes.Repository
The name of this repository.
This will be the ${repository} component of any URIs of types defined here.
getName
in interface FeatureTypes.Repository
public Set getTypes()
FeatureTypes.Repository
getTypes
in interface FeatureTypes.Repository
public FeatureTypes.Type getType(String name) throws NoSuchElementException
FeatureTypes.Repository
getType
in interface FeatureTypes.Repository
name
- the name of the TypeNoSuchElementException
- if that type can not be foundpublic FeatureTypes.Type createType(String name, FeatureFilter schema, Set parents)
name
- the Type nameschema
- the FeatureFilter defining the typeparents
- the Set (possibly empty) of parent URIsCopyright © 2014 BioJava. All rights reserved.