Package pl.poznan.put.structure
Class DotBracketSymbol
java.lang.Object
pl.poznan.put.structure.DotBracketSymbol
- All Implemented Interfaces:
Serializable,Comparable<DotBracketSymbol>
- Direct Known Subclasses:
ImmutableDotBracketSymbol
@Immutable
public abstract class DotBracketSymbol
extends Object
implements Comparable<DotBracketSymbol>, Serializable
A single symbol in a dot-bracket structure.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intabstract intindex()final booleanstatic booleanisClosing(char c) Checks if the given character is a closing character in dot-bracket format.final booleanfinal booleanstatic booleanisOpening(char c) Checks if the given character is an opening character in dot-bracket format.final booleanstatic booleanisPairing(char c) Checks if the given character is a pairing character in dot-bracket format.static charmatchingBracket(char c) Finds a matching bracket (closing for opening and vice versa) of the same level.final intorder()abstract charsequence()abstract charfinal StringtoString()
-
Constructor Details
-
DotBracketSymbol
public DotBracketSymbol()
-
-
Method Details
-
isPairing
public static boolean isPairing(char c) Checks if the given character is a pairing character in dot-bracket format.- Parameters:
c- The character to check.- Returns:
- True if
cis either an opening or closing symbol.
-
isOpening
public static boolean isOpening(char c) Checks if the given character is an opening character in dot-bracket format.- Parameters:
c- The character to check- Returns:
- True if
cis one of: ([{<ABCDEFGHIJKLMNOPQRSTUVWXYZ.
-
isClosing
public static boolean isClosing(char c) Checks if the given character is a closing character in dot-bracket format.- Parameters:
c- The character to check- Returns:
- True if
cis one of: )]}>abcdefghijklmnopqrstuvwxyz.
-
matchingBracket
public static char matchingBracket(char c) Finds a matching bracket (closing for opening and vice versa) of the same level.- Parameters:
c- The character to find a matching bracket for.- Returns:
- A matching bracket or a dot if the input is also a dot.
-
sequence
@Parameter(order=1) public abstract char sequence()- Returns:
- The sequence character.
-
structure
@Parameter(order=2) public abstract char structure()- Returns:
- The structure character (dot or bracket).
-
index
@Parameter(order=3) public abstract int index()- Returns:
- The index of this symbol.
-
isMissing
public final boolean isMissing()- Returns:
- True if this symbol is a minus '-'.
-
isPairing
public final boolean isPairing()- Returns:
- True if this symbol is either opening or closing.
-
isOpening
public final boolean isOpening()- Returns:
- True if this symbol is opening (see
isOpening(char)).
-
isClosing
public final boolean isClosing()- Returns:
- True if this symbol is closing (see
isClosing(char)).
-
order
public final int order()- Returns:
- The pseudoknot order of this symbol.
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<DotBracketSymbol>
-