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 java.lang.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, java.lang.Iterable<C> equivalents)
protected void
addEquivalent(C compound, C equivalent)
boolean
compoundsEqual(C compoundOne, C compoundTwo)
boolean
compoundsEquivalent(C compoundOne, C compoundTwo)
boolean
equals(java.lang.Object o)
java.util.List<C>
getAllCompounds()
C
getCompoundForString(java.lang.String string)
Return null if not recognised.java.util.Set<C>
getEquivalentCompounds(C compound)
int
getMaxSingleCompoundStringLength()
Returns the maximum size of a compound String this set holdsjava.lang.String
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)
-
-
-
Method Detail
-
addCompound
protected void addCompound(C compound, C lowerCasedCompound, java.lang.Iterable<C> equivalents)
-
addCompound
protected void addCompound(C compound)
-
getStringForCompound
public java.lang.String getStringForCompound(C compound)
- Specified by:
getStringForCompound
in interfaceCompoundSet<C extends Compound>
-
getCompoundForString
public C getCompoundForString(java.lang.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 java.util.Set<C> getEquivalentCompounds(C compound)
- Specified by:
getEquivalentCompounds
in interfaceCompoundSet<C extends Compound>
-
isValidSequence
public boolean isValidSequence(Sequence<C> sequence)
- Specified by:
isValidSequence
in interfaceCompoundSet<C extends Compound>
-
getAllCompounds
public java.util.List<C> 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()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-