Class AbstractCompoundSet<C extends Compound>
java.lang.Object
org.biojava.nbio.core.sequence.template.AbstractCompoundSet<C>
- Type Parameters:
C
- The compound this set will contain
- All Implemented Interfaces:
CompoundSet<C>
- Direct Known Subclasses:
AbstractNucleotideCompoundSet
public abstract class AbstractCompoundSet<C extends Compound>
extends Object
implements CompoundSet<C>
- Author:
- Andy Yates
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCompound
(C compound) protected void
addCompound
(C compound, C lowerCasedCompound, C... equivalents) protected void
addCompound
(C compound, C lowerCasedCompound, Iterable<C> equivalents) protected void
addEquivalent
(C compound, C equivalent) boolean
compoundsEqual
(C compoundOne, C compoundTwo) boolean
compoundsEquivalent
(C compoundOne, C compoundTwo) boolean
getCompoundForString
(String string) Return null if not recognised.getEquivalentCompounds
(C compound) int
Returns the maximum size of a compound String this set holdsgetStringForCompound
(C compound) boolean
hasCompound
(C compound) int
hashCode()
boolean
boolean
Returns true if all String representations of Compounds are of the same length.boolean
isValidSequence
(Sequence<C> sequence)
-
Constructor Details
-
AbstractCompoundSet
public AbstractCompoundSet()
-
-
Method Details
-
addCompound
-
addCompound
-
addEquivalent
-
addCompound
-
getStringForCompound
- Specified by:
getStringForCompound
in interfaceCompoundSet<C extends Compound>
-
getCompoundForString
Description copied from interface:CompoundSet
Return null if not recognised. Throw IllegalArgumentException if string is longer than maximum allowed byCompoundSet.getStringForCompound(Compound)
.- Specified by:
getCompoundForString
in interfaceCompoundSet<C extends Compound>
-
getMaxSingleCompoundStringLength
public int getMaxSingleCompoundStringLength()Description copied from interface:CompoundSet
Returns the maximum size of a compound String this set holds- Specified by:
getMaxSingleCompoundStringLength
in interfaceCompoundSet<C extends Compound>
-
isCompoundStringLengthEqual
public boolean isCompoundStringLengthEqual()Description copied from interface:CompoundSet
Returns true if all String representations of Compounds are of the same length.- Specified by:
isCompoundStringLengthEqual
in interfaceCompoundSet<C extends Compound>
-
hasCompound
- Specified by:
hasCompound
in interfaceCompoundSet<C extends Compound>
-
compoundsEquivalent
- Specified by:
compoundsEquivalent
in interfaceCompoundSet<C extends Compound>
-
getEquivalentCompounds
- Specified by:
getEquivalentCompounds
in interfaceCompoundSet<C extends Compound>
-
compoundsEqual
-
isValidSequence
- Specified by:
isValidSequence
in interfaceCompoundSet<C extends Compound>
-
getAllCompounds
- Specified by:
getAllCompounds
in interfaceCompoundSet<C extends Compound>
-
isComplementable
public boolean isComplementable()- Specified by:
isComplementable
in interfaceCompoundSet<C extends Compound>
-
hashCode
public int hashCode() -
equals
-