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 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
equals(Object o)
List<C>
getAllCompounds()
C
getCompoundForString(String string)
Return null if not recognised.Set<C>
getEquivalentCompounds(C compound)
int
getMaxSingleCompoundStringLength()
Returns the maximum size of a compound String this set holdsString
getStringForCompound(C compound)
boolean
hasCompound(C compound)
int
hashCode()
boolean
isComplementable()
boolean
isCompoundStringLengthEqual()
Returns true if all String representations of Compounds are of the same length.boolean
isValidSequence(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:
getStringForCompound
in interfaceCompoundSet<C extends Compound>
-
getCompoundForString
public C getCompoundForString(String string)
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
public boolean hasCompound(C compound)
- Specified by:
hasCompound
in interfaceCompoundSet<C extends Compound>
-
compoundsEquivalent
public boolean compoundsEquivalent(C compoundOne, C compoundTwo)
- Specified by:
compoundsEquivalent
in interfaceCompoundSet<C extends Compound>
-
getEquivalentCompounds
public Set<C> getEquivalentCompounds(C compound)
- Specified by:
getEquivalentCompounds
in interfaceCompoundSet<C extends Compound>
-
compoundsEqual
public boolean compoundsEqual(C compoundOne, C compoundTwo)
-
isValidSequence
public boolean isValidSequence(Sequence<C> sequence)
- Specified by:
isValidSequence
in interfaceCompoundSet<C extends Compound>
-
getAllCompounds
public List<C> getAllCompounds()
- Specified by:
getAllCompounds
in interfaceCompoundSet<C extends Compound>
-
isComplementable
public boolean isComplementable()
- Specified by:
isComplementable
in interfaceCompoundSet<C extends Compound>
-
-