2121package org .biojava .nbio .structure .secstruc ;
2222
2323/**
24- * This enum contains all of the secondary structure types found
25- * in the DSSP output. It also contains some methods to operate
26- * with the SS types.
24+ * This enum contains all of the secondary structure types found in the DSSP
25+ * output. It also contains some methods to operate with the SS types.
2726 * <p>
28- * When compared, the types are sorted in the declaration order of
29- * the enum, which is the DSSP preference of type assignment.
27+ * When compared, the types are sorted in the declaration order of the enum,
28+ * which is the DSSP preference of type assignment.
3029 *
3130 * @author Andreas Prlic
3231 * @author Aleix Lafita
3332 *
3433 */
3534public enum SecStrucType {
3635
37- helix4 ("alpha Helix" ,'H' ),
38- extended ("Extended" ,'E' ),
39- bridge ("Bridge" ,'B' ),
40- helix3 ("3-10 Helix" ,'G' ),
41- helix5 ("pi Helix" ,'I' ),
42- turn ("Turn" ,'T' ),
43- bend ("Bend" ,'S' ),
44- coil ("Coil" ,' ' );
36+ helix4 ("alpha Helix" , 'H' ),
37+ extended ("Extended" , 'E' ),
38+ bridge ("Bridge" , 'B' ),
39+ helix3 ("3-10 Helix" , 'G' ),
40+ helix5 ("pi Helix" , 'I' ),
41+ turn ("Turn" , 'T' ),
42+ bend ("Bend" , 'S' ),
43+ coil ("Coil" , ' ' );
4544
4645 public final Character type ;
4746 public final String name ;
4847
49- private SecStrucType (String name , Character stype ){
48+ private SecStrucType (String name , Character stype ) {
5049 this .name = name ;
5150 this .type = stype ;
5251 }
5352
5453 /**
55- * Converts a Character representing a Secondary Structure type
56- * into the corresponding enum object.
54+ * Converts a Character representing a Secondary Structure type into the
55+ * corresponding enum object.
5756 *
58- * @param stype the character representing the SS type
57+ * @param stype
58+ * the character representing the SS type
5959 * @return SecStrucType or null if the character is invalid
6060 */
61- public static SecStrucType fromCharacter (Character stype ){
61+ public static SecStrucType fromCharacter (Character stype ) {
6262
63- for (SecStrucType c : SecStrucType .values ()){
64- if ( c .type .equals (stype )){
63+ for (SecStrucType c : SecStrucType .values ()) {
64+ if (c .type .equals (stype )) {
6565 return c ;
6666 }
6767 }
6868 return null ;
6969 }
7070
7171 @ Override
72- public String toString (){
72+ public String toString () {
7373 return type .toString ();
7474 }
7575
7676 /**
7777 * Helix type can be 3-10 helix, pi-helix or alpha-helix.
78+ *
7879 * @return true if the type is any of the helix types, false otherwise
7980 */
8081 public boolean isHelixType () {
81- if (type .equals (helix4 .type ) ||
82- type .equals (helix3 .type ) ||
83- type .equals (helix5 .type ))
82+ if (type .equals (helix4 .type ) || type .equals (helix3 .type )
83+ || type .equals (helix5 .type ))
84+ return true ;
85+ else
86+ return false ;
87+ }
88+
89+ /**
90+ * A Beta-Strand is an extended set of sequential Bridges that, together
91+ * with other Beta-Strands, is part of a Beta-Sheet.
92+ *
93+ * @return true if the type is a Beta-Strand
94+ */
95+ public boolean isBetaStrand () {
96+ if (type .equals (extended .type ))
8497 return true ;
85- else return false ;
98+ else
99+ return false ;
86100 }
87101
88102}
0 commit comments