Skip to content

Commit 361a023

Browse files
author
luke czapla
committed
made max values non-static and created final DEFAULT constants
1 parent 0d0ed55 commit 361a023

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

biojava-structure/src/main/java/org/biojava/nbio/structure/basepairs/MismatchedBasePairParameters.java

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.biojava.nbio.structure.contact.Pair;
2929

3030
import javax.vecmath.Matrix4d;
31-
import java.io.Serializable;
3231
import java.util.ArrayList;
3332
import java.util.List;
3433

@@ -42,9 +41,16 @@
4241
*/
4342
public class MismatchedBasePairParameters extends BasePairParameters {
4443

44+
public static final double DEFAULT_MAX_STAGGER = 2.0;
45+
public static final double DEFAULT_MAX_PROPELLER = 60.0;
46+
public static final double DEFAULT_MAX_SHEAR = 5.0;
47+
public static final double DEFAULT_MAX_STRETCH = 5.0;
48+
4549
// These are the criteria used to select proper base pairs.
46-
protected static double maxStagger = 2.0, maxShear = 5.0, maxStretch = 5.0,
47-
maxPropeller = 60.0;
50+
private double maxStagger = DEFAULT_MAX_STAGGER,
51+
maxShear = DEFAULT_MAX_SHEAR,
52+
maxStretch = DEFAULT_MAX_STRETCH,
53+
maxPropeller = DEFAULT_MAX_PROPELLER;
4854

4955
/**
5056
* This constructor is used to create the TertiaryBasePairParameters object. The parent constructors are valid
@@ -124,39 +130,39 @@ public List<Pair<Group>> findPairs(List<Chain> chains) {
124130
* This method returns the maximum stagger between bases used as criteria for the characterization of two bases as being paired.
125131
* @return the maximum propeller ("propeller-twist", in degrees) allowed.
126132
*/
127-
public static double getMaxStagger() {
133+
public double getMaxStagger() {
128134
return maxStagger;
129135
}
130136

131137
/**
132138
* This method sets the maximum stagger allowed for a base pair, prior to analyze() call
133139
* @param maxStagger The maximum propeller (in Å) allowed to consider two bases paired
134140
*/
135-
public static void setMaxStagger(double maxStagger) {
141+
public void setMaxStagger(double maxStagger) {
136142
maxStagger = maxStagger;
137143
}
138144

139145
/**
140146
* This method returns the maximum shear between bases used as criteria for the characterization of two bases as being paired.
141147
* @return the maximum shear (in Å) allowed.
142148
*/
143-
public static double getMaxShear() {
149+
public double getMaxShear() {
144150
return maxShear;
145151
}
146152

147153
/**
148154
* This method sets the maximum shear allowed for a base pair, prior to analyze() call
149155
* @param maxShear The maximum shear (in Å) allowed to consider two bases paired
150156
*/
151-
public static void setMaxShear(double maxShear) {
157+
public void setMaxShear(double maxShear) {
152158
maxShear = maxShear;
153159
}
154160

155161
/**
156162
* This method returns the maximum stretch between bases used as criteria for the characterization of two bases as being paired.
157163
* @return the maximum stretch (in Å) allowed.
158164
*/
159-
public static double getMaxStretch() {
165+
public double getMaxStretch() {
160166
return maxStretch;
161167
}
162168

@@ -172,15 +178,15 @@ public static void setMaxStretch(double maxStretch) {
172178
* This method returns the maximum propeller twist between bases used as criteria for the characterization of two bases as being paired.
173179
* @return the maximum propeller ("propeller-twist", in degrees) allowed.
174180
*/
175-
public static double getMaxPropeller() {
181+
public double getMaxPropeller() {
176182
return maxPropeller;
177183
}
178184

179185
/**
180186
* This method sets the maximum propeller allowed for a base pair, prior to analyze() call
181187
* @param maxPropeller The maximum propeller ("propeller-twist", in degrees) allowed to consider two bases paired
182188
*/
183-
public static void setMaxPropeller(double maxPropeller) {
189+
public void setMaxPropeller(double maxPropeller) {
184190
maxPropeller = maxPropeller;
185191
}
186192
}

biojava-structure/src/main/java/org/biojava/nbio/structure/basepairs/TertiaryBasePairParameters.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.biojava.nbio.structure.contact.Pair;
2929

3030
import javax.vecmath.Matrix4d;
31-
import java.io.Serializable;
3231
import java.util.ArrayList;
3332
import java.util.List;
3433

@@ -43,8 +42,11 @@
4342
*/
4443
public class TertiaryBasePairParameters extends BasePairParameters {
4544

45+
public static final double DEFAULT_MAX_STAGGER = 2.0;
46+
public static final double DEFAULT_MAX_PROPELLER = 60.0;
4647
// These are the criteria used to select proper base pairs.
47-
protected static double maxStagger = 2.0, maxPropeller = 60.0;
48+
private double maxStagger = DEFAULT_MAX_STAGGER,
49+
maxPropeller = DEFAULT_MAX_PROPELLER;
4850

4951
public TertiaryBasePairParameters(Structure structure, boolean RNA, boolean removeDups) {
5052
super(structure, RNA, removeDups);
@@ -106,31 +108,31 @@ public List<Pair<Group>> findPairs(List<Chain> chains) {
106108
* This method returns the maximum stagger between bases used as criteria for the characterization of two bases as being paired.
107109
* @return the maximum stagger (in Å) allowed.
108110
*/
109-
public static double getMaxStagger() {
111+
public double getMaxStagger() {
110112
return maxStagger;
111113
}
112114

113115
/**
114116
* This method sets the maximum stagger allowed for a base pair, prior to analyze() call
115117
* @param maxStagger The maximum stagger (in Å) allowed to consider two bases paired
116118
*/
117-
public static void setMaxStagger(double maxStagger) {
119+
public void setMaxStagger(double maxStagger) {
118120
maxStagger = maxStagger;
119121
}
120122

121123
/**
122124
* This method returns the maximum propeller twist between bases used as criteria for the characterization of two bases as being paired.
123125
* @return the maximum propeller ("propeller-twist", in degrees) allowed.
124126
*/
125-
public static double getMaxPropeller() {
127+
public double getMaxPropeller() {
126128
return maxPropeller;
127129
}
128130

129131
/**
130132
* This method sets the maximum propeller allowed for a base pair, prior to analyze() call
131133
* @param maxPropeller The maximum propeller ("propeller-twist", in degrees) allowed to consider two bases paired
132134
*/
133-
public static void setMaxPropeller(double maxPropeller) {
135+
public void setMaxPropeller(double maxPropeller) {
134136
maxPropeller = maxPropeller;
135137
}
136138
}

0 commit comments

Comments
 (0)