Package org.biojava.utils
Class Unchangeable
java.lang.Object
org.biojava.utils.Unchangeable
- All Implemented Interfaces:
Changeable
- Direct Known Subclasses:
AlternateTokenization,BioFetchSequenceDB,CharacterTokenization,DoubleAlphabet,DoubleAlphabet.DoubleRange,DoubleAlphabet.DoubleSymbol,DoubleAlphabet.SubDoubleAlphabet,EmptyRichAnnotation,EmptyRichLocation,FeatureHolder.EmptyFeatureHolder,FlatSequenceDB,GapDistribution,IntegerAlphabet,IntegerAlphabet.IntegerSymbol,IntegerOntology,IntegerOntology.IntTerm,RelabeledAlignment,SimilarityPairFeature.EmptyPairwiseAlignment,SimpleCrossRef,SimpleDocRefAuthor,SimpleStatePath,SoftMaskedAlphabet,SoftMaskedAlphabet.CaseSensitiveTokenization,Triple.Impl,ViewSequence,WordTokenization
This is a utility implementation of Changeable that doesn't fire any events
or keep references to any listeners. Use this when you have a final immutable
class and can't be bothered to fill in all those method stubs.
- Since:
- 1.3
- Author:
- Matthew Pocock
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdd a listener that will be informed of all changes.final voidAdd a listener that will be informed of changes of a given type.final voidaddForwarder(ChangeForwarder cf, ChangeType ct) final Setfinal Setfinal booleanA particular ChangeType can never be raised by this Changeable.final voidRemove a listener that was interested in all types of changes.final voidRemove a listener that was interested in a specific types of changes.final voidremoveForwarder(ChangeForwarder cf, ChangeType ct)
-
Constructor Details
-
Unchangeable
public Unchangeable()
-
-
Method Details
-
addChangeListener
Description copied from interface:ChangeableAdd a listener that will be informed of all changes.- Specified by:
addChangeListenerin interfaceChangeable- Parameters:
cl- the ChangeListener to add
-
addChangeListener
Description copied from interface:ChangeableAdd a listener that will be informed of changes of a given type.- Specified by:
addChangeListenerin interfaceChangeable- Parameters:
cl- the ChangeListenerct- the ChangeType it is to be informed of
-
getListeners
-
removeChangeListener
Description copied from interface:ChangeableRemove a listener that was interested in all types of changes.- Specified by:
removeChangeListenerin interfaceChangeable- Parameters:
cl- a ChangeListener to remove
-
removeChangeListener
Description copied from interface:ChangeableRemove a listener that was interested in a specific types of changes.- Specified by:
removeChangeListenerin interfaceChangeable- Parameters:
cl- a ChangeListener to removect- the ChangeType that it was interested in
-
addForwarder
-
removeForwarder
-
getForwarders
-
isUnchanging
Description copied from interface:ChangeableA particular ChangeType can never be raised by this Changeable.
If this returns true, then it is guaranteed that change events of this type (and all child types) can never under any circumstances be fired by this Changeable instance. If it returns false, that does not mean that this type of event will or even can be raised, but that it is worth registering listeners incase.
- Specified by:
isUnchangingin interfaceChangeable- Parameters:
ct- the ChangeType to check- Returns:
- true if ChangeEvents of this type are guaranteed to never be fired
-