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 void
Add a listener that will be informed of all changes.final void
Add a listener that will be informed of changes of a given type.final void
addForwarder
(ChangeForwarder cf, ChangeType ct) final Set
final Set
final boolean
A particular ChangeType can never be raised by this Changeable.final void
Remove a listener that was interested in all types of changes.final void
Remove a listener that was interested in a specific types of changes.final void
removeForwarder
(ChangeForwarder cf, ChangeType ct)
-
Constructor Details
-
Unchangeable
public Unchangeable()
-
-
Method Details
-
addChangeListener
Description copied from interface:Changeable
Add a listener that will be informed of all changes.- Specified by:
addChangeListener
in interfaceChangeable
- Parameters:
cl
- the ChangeListener to add
-
addChangeListener
Description copied from interface:Changeable
Add a listener that will be informed of changes of a given type.- Specified by:
addChangeListener
in interfaceChangeable
- Parameters:
cl
- the ChangeListenerct
- the ChangeType it is to be informed of
-
getListeners
-
removeChangeListener
Description copied from interface:Changeable
Remove a listener that was interested in all types of changes.- Specified by:
removeChangeListener
in interfaceChangeable
- Parameters:
cl
- a ChangeListener to remove
-
removeChangeListener
Description copied from interface:Changeable
Remove a listener that was interested in a specific types of changes.- Specified by:
removeChangeListener
in interfaceChangeable
- Parameters:
cl
- a ChangeListener to removect
- the ChangeType that it was interested in
-
addForwarder
-
removeForwarder
-
getForwarders
-
isUnchanging
Description copied from interface:Changeable
A 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:
isUnchanging
in interfaceChangeable
- Parameters:
ct
- the ChangeType to check- Returns:
- true if ChangeEvents of this type are guaranteed to never be fired
-