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
Constructors Constructor Description AbstractCompoundSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddCompound(C compound)protected voidaddCompound(C compound, C lowerCasedCompound, C... equivalents)protected voidaddCompound(C compound, C lowerCasedCompound, Iterable<C> equivalents)protected voidaddEquivalent(C compound, C equivalent)booleancompoundsEqual(C compoundOne, C compoundTwo)booleancompoundsEquivalent(C compoundOne, C compoundTwo)booleanequals(Object o)List<C>getAllCompounds()CgetCompoundForString(String string)Return null if not recognised.Set<C>getEquivalentCompounds(C compound)intgetMaxSingleCompoundStringLength()Returns the maximum size of a compound String this set holdsStringgetStringForCompound(C compound)booleanhasCompound(C compound)inthashCode()booleanisComplementable()booleanisCompoundStringLengthEqual()Returns true if all String representations of Compounds are of the same length.booleanisValidSequence(Sequence<C> sequence)
-
-
-
Constructor Detail
-
AbstractCompoundSet
public AbstractCompoundSet()
-
-
Method Detail
-
addCompound
protected void addCompound(C compound, C lowerCasedCompound, Iterable<C> equivalents)
-
addCompound
protected void addCompound(C compound, C lowerCasedCompound, C... equivalents)
-
addEquivalent
protected void addEquivalent(C compound, C equivalent)
-
addCompound
protected void addCompound(C compound)
-
getStringForCompound
public String getStringForCompound(C compound)
- Specified by:
getStringForCompoundin interfaceCompoundSet<C extends Compound>
-
getCompoundForString
public C getCompoundForString(String string)
Description copied from interface:CompoundSetReturn null if not recognised. Throw IllegalArgumentException if string is longer than maximum allowed byCompoundSet.getStringForCompound(Compound).- Specified by:
getCompoundForStringin interfaceCompoundSet<C extends Compound>
-
getMaxSingleCompoundStringLength
public int getMaxSingleCompoundStringLength()
Description copied from interface:CompoundSetReturns the maximum size of a compound String this set holds- Specified by:
getMaxSingleCompoundStringLengthin interfaceCompoundSet<C extends Compound>
-
isCompoundStringLengthEqual
public boolean isCompoundStringLengthEqual()
Description copied from interface:CompoundSetReturns true if all String representations of Compounds are of the same length.- Specified by:
isCompoundStringLengthEqualin interfaceCompoundSet<C extends Compound>
-
hasCompound
public boolean hasCompound(C compound)
- Specified by:
hasCompoundin interfaceCompoundSet<C extends Compound>
-
compoundsEquivalent
public boolean compoundsEquivalent(C compoundOne, C compoundTwo)
- Specified by:
compoundsEquivalentin interfaceCompoundSet<C extends Compound>
-
getEquivalentCompounds
public Set<C> getEquivalentCompounds(C compound)
- Specified by:
getEquivalentCompoundsin interfaceCompoundSet<C extends Compound>
-
compoundsEqual
public boolean compoundsEqual(C compoundOne, C compoundTwo)
-
isValidSequence
public boolean isValidSequence(Sequence<C> sequence)
- Specified by:
isValidSequencein interfaceCompoundSet<C extends Compound>
-
getAllCompounds
public List<C> getAllCompounds()
- Specified by:
getAllCompoundsin interfaceCompoundSet<C extends Compound>
-
isComplementable
public boolean isComplementable()
- Specified by:
isComplementablein interfaceCompoundSet<C extends Compound>
-
-