Skip to content

Commit 706a60a

Browse files
committed
Cosmetics and possible bugfix
1 parent afdb837 commit 706a60a

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucCalc.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
*
5252
* @author Andreas Prlic
5353
* @author Aleix Lafita
54-
* @autho Anthony Bradley
54+
* @author Anthony Bradley
5555
*
5656
*/
5757
public class SecStrucCalc {
@@ -83,7 +83,8 @@ public class SecStrucCalc {
8383
/** higher limit for H-bond energy */
8484
public static final double HBONDHIGHENERGY = -500.0;
8585

86-
/** constant for electrostatic energy
86+
/**
87+
* constant for electrostatic energy
8788
* <pre>
8889
* f * q1 * q2 * scale
8990
* Q = -332 * 0.42 * 0.20 * 1000.0

biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucElement.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public class SecStrucElement implements Serializable {
3737

3838
private static final long serialVersionUID = -8485685793171396131L;
3939

40-
private SecStrucType type;
41-
private ResidueRangeAndLength range;
42-
private int index;
40+
private final SecStrucType type;
41+
private final ResidueRangeAndLength range;
42+
private final int index;
4343

4444
/**
4545
* Create a new SSE object. The start and end residue numbers cannot be the

biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucGroup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public SecStrucGroup() {
5353
@Override
5454
public String toString() {
5555

56-
StringBuffer str = new StringBuffer("SecStrucGroup ");
56+
StringBuilder str = new StringBuilder("SecStrucGroup ");
5757
str.append(residueNumber);
5858
str.append(" ");
5959
str.append(pdb_name);

biojava-structure/src/main/java/org/biojava/nbio/structure/secstruc/SecStrucTools.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class SecStrucTools {
5050
*/
5151
public static List<SecStrucInfo> getSecStrucInfo(Structure s) {
5252

53-
List<SecStrucInfo> listSSI = new ArrayList<SecStrucInfo>();
53+
List<SecStrucInfo> listSSI = new ArrayList<>();
5454
GroupIterator iter = new GroupIterator(s);
5555

5656
while (iter.hasNext()) {
@@ -88,7 +88,7 @@ public static void assignSecStruc( Structure s,List<SecStrucInfo> listSSI){
8888
*/
8989
public static List<SecStrucElement> getSecStrucElements(Structure s) {
9090

91-
List<SecStrucElement> listSSE = new ArrayList<SecStrucElement>();
91+
List<SecStrucElement> listSSE = new ArrayList<>();
9292
GroupIterator iter = new GroupIterator(s);
9393

9494
// SecStruc information - initialize
@@ -114,7 +114,7 @@ public static List<SecStrucElement> getSecStrucElements(Structure s) {
114114

115115
if (count > 0) {
116116
// If chain and type are equal increment counter
117-
if (ss.type == type && chainId == g.getChainId()) {
117+
if (ss.type == type && chainId.equals(g.getChainId())) {
118118
previous = g.getResidueNumber();
119119
count++;
120120
continue;
@@ -161,7 +161,7 @@ public static List<SecStrucElement> getSecStrucElements(Structure s) {
161161
*/
162162
public static List<SecStrucElement> getSecStrucElements(List<Group> groups) {
163163

164-
List<SecStrucElement> listSSE = new ArrayList<SecStrucElement>();
164+
List<SecStrucElement> listSSE = new ArrayList<>();
165165

166166
// SecStruc information - initialize
167167
SecStrucType type = SecStrucType.coil;
@@ -171,7 +171,7 @@ public static List<SecStrucElement> getSecStrucElements(List<Group> groups) {
171171
int count = 0; // counts the number of residues in SSE
172172

173173
// Create a map for the IDs of the SSE in the structure
174-
Map<SecStrucType, Integer> ids = new TreeMap<SecStrucType, Integer>();
174+
Map<SecStrucType, Integer> ids = new TreeMap<>();
175175
for (SecStrucType t : SecStrucType.values())
176176
ids.put(t, 1);
177177

@@ -185,7 +185,7 @@ public static List<SecStrucElement> getSecStrucElements(List<Group> groups) {
185185

186186
if (count > 0) {
187187
// If chain and type are equal increment counter
188-
if (ss.type == type && chainId == g.getChainId()) {
188+
if (ss.type == type && chainId.equals(g.getChainId())) {
189189
previous = g.getResidueNumber();
190190
count++;
191191
continue;

0 commit comments

Comments
 (0)